{"action":"created","issue":{"url":"https://api.github.com/repos/perusio/drupal-with-nginx/issues/198","labels_url":"https://api.github.com/repos/perusio/drupal-with-nginx/issues/198/labels{/name}","comments_url":"https://api.github.com/repos/perusio/drupal-with-nginx/issues/198/comments","events_url":"https://api.github.com/repos/perusio/drupal-with-nginx/issues/198/events","html_url":"https://github.com/perusio/drupal-with-nginx/issues/198","id":52416462,"number":198,"title":"'expires epoch' directive causes upstream cache headers to be ignored","user":{"login":"durist","id":3100550,"avatar_url":"https://avatars.githubusercontent.com/u/3100550?v=3","gravatar_id":"","url":"https://api.github.com/users/durist","html_url":"https://github.com/durist","followers_url":"https://api.github.com/users/durist/followers","following_url":"https://api.github.com/users/durist/following{/other_user}","gists_url":"https://api.github.com/users/durist/gists{/gist_id}","starred_url":"https://api.github.com/users/durist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/durist/subscriptions","organizations_url":"https://api.github.com/users/durist/orgs","repos_url":"https://api.github.com/users/durist/repos","events_url":"https://api.github.com/users/durist/events{/privacy}","received_events_url":"https://api.github.com/users/durist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-12-18T21:08:17Z","updated_at":"2015-10-22T09:32:44Z","closed_at":null,"body":"apps/drupal/microcache_fcgi.conf has the following:\r\n\r\n```\r\n## The Cache-Control and Expires headers should be delivered untouched\r\n## from the upstream to the client.\r\nfastcgi_ignore_headers Cache-Control Expires;\r\n## Bypass the cache.\r\nfastcgi_cache_bypass $no_cache;\r\nfastcgi_no_cache $no_cache;\r\n## Add a cache miss/hit status header.\r\nadd_header X-Micro-Cache $upstream_cache_status;\r\n## To avoid any interaction with the cache control headers we expire\r\n## everything on this location immediately.\r\nexpires epoch;\r\n```\r\nHowever, the `expires epoch` line apparently takes precedence over `fastcgi_ignore_headers Cache-Control Expires;`\r\n\r\nHeaders with `expires epoch;`:\r\n```\r\nHTTP/1.1 200 OK\r\nServer: nginx\r\nDate: Thu, 18 Dec 2014 20:43:48 GMT\r\nContent-Type: application/xml\r\nConnection: keep-alive\r\nKeep-Alive: timeout=10\r\nVary: Accept-Encoding\r\nEtag: \"1418928287-0\"\r\nCache-Control: no-cache\r\nExpires: Thu, 01 Jan 1970 00:00:01 GMT\r\nX-Microcachable: 0\r\nContent-Language: en\r\nLast-Modified: Thu, 18 Dec 2014 18:44:47 GMT\r\nVary: Cookie\r\nVary: Accept-Encoding\r\nX-Micro-Cache: EXPIRED\r\nX-Content-Options: nosniff\r\n```\r\n\r\nIdentical configuration without `expires epoch;`:\r\n```\r\nHTTP/1.1 200 OK\r\nServer: nginx\r\nDate: Thu, 18 Dec 2014 20:44:37 GMT\r\nContent-Type: application/xml\r\nConnection: keep-alive\r\nKeep-Alive: timeout=10\r\nVary: Accept-Encoding\r\nEtag: \"1418928287-0\"\r\nCache-Control: public, max-age=2592000\r\nExpires: Sat, 1 Jan 2015 06:44:48 GMT\r\nX-Microcachable: 0\r\nContent-Language: en\r\nLast-Modified: Thu, 18 Dec 2014 18:44:47 GMT\r\nVary: Cookie\r\nVary: Accept-Encoding\r\nX-Micro-Cache: MISS\r\nX-Content-Options: nosniff\r\n```\r\nIt looks like the `expires epoch` directive is redundant and should be removed."},"comment":{"url":"https://api.github.com/repos/perusio/drupal-with-nginx/issues/comments/150161473","html_url":"https://github.com/perusio/drupal-with-nginx/issues/198#issuecomment-150161473","issue_url":"https://api.github.com/repos/perusio/drupal-with-nginx/issues/198","id":150161473,"user":{"login":"cclafferty","id":553381,"avatar_url":"https://avatars.githubusercontent.com/u/553381?v=3","gravatar_id":"","url":"https://api.github.com/users/cclafferty","html_url":"https://github.com/cclafferty","followers_url":"https://api.github.com/users/cclafferty/followers","following_url":"https://api.github.com/users/cclafferty/following{/other_user}","gists_url":"https://api.github.com/users/cclafferty/gists{/gist_id}","starred_url":"https://api.github.com/users/cclafferty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclafferty/subscriptions","organizations_url":"https://api.github.com/users/cclafferty/orgs","repos_url":"https://api.github.com/users/cclafferty/repos","events_url":"https://api.github.com/users/cclafferty/events{/privacy}","received_events_url":"https://api.github.com/users/cclafferty/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T09:32:44Z","updated_at":"2015-10-22T09:32:44Z","body":"Hi @perusio just wanted to say thanks for clearing this up. Throughout this entire thread we thought this was a bug or at least some unwanted side effect. Although I may not agree with Nginx being the authority on cache at least this was done by design. I would recommend leaving a comment surrounding the tags `expires epoch;` to suggest that's what it's doing. Cheers."}}