We are using Nginx as a reverse proxy and everything seems to work fine.We have caching enabled and this was working fine from Nov 15 to Nov 30. The proxied server returns a request which has expires header set to expire after 5 mins. However this stopped working on Dec 1. And the culprit seems to be the date format. With a simple test case we were able to figure out that :
new org.mockserver.model.Header("Expires", "Tue, 04 Dec 2018 16:23:31 GMT")
Works fine. However this fails:
new org.mockserver.model.Header("Expires", "Tue, 4 Dec 2018 16:23:31 GMT")
The following are my proxy settings:
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=nginx_cache:10m max_size=10g use_temp_path=off;
proxy_cache nginx_cache;
proxy_cache_methods GET;
proxy_ignore_headers Set-Cookie;
Is it a problem with my configuration or is it a issue with Nginx ? This was issue we tried in bot Nginx version 1.3.7 and 1.3.10
EDITED These headers were sent from a thirdparty API. However they seem to be also sending other headers (example form test case):
new org.mockserver.model.Header("Date", "Tue, 04 Dec 2018 16:13:45 GMT"),
new org.mockserver.model.Header("Expires", "Tue, 6 Dec 2018 16:23:31 GMT"),
new org.mockserver.model.Header("Cache-Control", "max-age=586, must-revalidate")
and as per this link, the cache-control should have had precedence : what’s the difference between Expires and Cache-Control headers?
But nginx somehow seems to fail on the expires header.