Welcome! Log In Create A New Profile

Advanced

Re: Nginx cache-control headers issue

Francis Daly
July 19, 2019 06:48PM
On Thu, Jul 18, 2019 at 06:44:13PM -0400, andregr-jp wrote:

Hi there,

> I have an nginx proxy which suddenly adding 2 cache-control headers and the
> last modified time is always the current time:

I suspect that whatever is being reverse-proxied changed recently to
send these headers.

> #Add Headers
> add_header Cache-Control 'public max-age=31536000
> s-maxage=31536000';

add_header is "please send this in the nginx response, as well as
everything else".

> proxy_hide_header x-amz-id-2;

proxy_hide_header is "please do not send this, from upstream to the
client".

> proxy_ignore_headers Cache-Control;

proxy_ignore_headers is "don't use these special headers".

> I don't know why is adding this control header: Cache-Control: private,
> max-age=3600, max-stale=0

You probably want to add "proxy_hide_header Cache-Control"; or to change
back whatever changed on your upstream which made it claim that things
are public.

You can look at the response from upstream (e.g.,
$upstream_http_cache_control) to confirm whether the header is set there.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx cache-control headers issue

andregr-jp July 18, 2019 06:38PM

Re: Nginx cache-control headers issue

Francis Daly July 19, 2019 06:48PM

Re: Nginx cache-control headers issue

andregr-jp July 19, 2019 08:34PM

Re: Nginx cache-control headers issue

andregr-jp July 19, 2019 09:48PM

Re: Nginx cache-control headers issue

Francis Daly July 20, 2019 03:40AM

Re: Nginx cache-control headers issue

andregr-jp July 20, 2019 06:12AM

Re: Nginx cache-control headers issue

Francis Daly July 21, 2019 08:28AM

Re: Nginx cache-control headers issue

andregr-jp July 25, 2019 08:04AM

Re: Nginx cache-control headers issue

Francis Daly August 01, 2019 01:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 236
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready