Welcome! Log In Create A New Profile

Advanced

Re: proxy_ignore_headers doesn't seem to work

Maxim Dounin
December 18, 2011 06:18AM
Hello!

On Sat, Dec 17, 2011 at 10:19:29AM -0500, piotr wrote:

> Maxim Dounin Wrote:
> > Try "nginx -t". If it doesn't help, please post
> > the full config
> > you're testing with.
> >
>
> Hi,
>
> Maxim, thank you for your response!
>
> I've checked both servers for config errors before, but without any
> clues.

[...]

> ***** sample headers from upstream server:
>
> http://otile3.mqcdn.com/tiles/1.0.0/osm/15/5240/12661.jpg
>
> GET /tiles/1.0.0/osm/15/5240/12661.jpg HTTP/1.1
> Host: otile3.mqcdn.com
> User-Agent: Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:8.0) Gecko/20100101
> Firefox/8.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language: en,en-us;q=0.7,pl;q=0.3
> Accept-Encoding: gzip, deflate
> Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
> Connection: keep-alive
> If-Modified-Since: Tue, 13 Dec 2011 06:16:41 GMT
>
> HTTP/1.1 304 Not Modified
> Content-Type: image/jpeg
> Expires: Fri, 16 Dec 2011 14:16:45 GMT
> Last-Modified: Tue, 13 Dec 2011 06:16:41 GMT
> Cache-Control: max-age=600
> Date: Fri, 16 Dec 2011 14:06:45 GMT
> Connection: keep-alive

Note:
Expires == Date + Cache-Control max-age.

> ***** sample headers from nginx proxy
> http://mpq1.XXX.com/tiles/1.0.0/osm/15/5240/12661.jpg
>
> GET /tiles/1.0.0/osm/15/5240/12661.jpg HTTP/1.1
> Host: mpq1.XXX.com
> User-Agent: Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:8.0) Gecko/20100101
> Firefox/8.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language: en,en-us;q=0.7,pl;q=0.3
> Accept-Encoding: gzip, deflate
> Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
> Connection: keep-alive
> Cookie: bblastvisit=1323941196; bblastactivity=0;
> __qca=P0-811271075-1323941200190;
> __utma=26892847.397077741.1323941200.1323964564.1324035857.4;
> __utmz=26892847.1323941200.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
> bbuserid=33280; bbpassword=be7f8ba39107f78fb42020ad76ca953b;
> __utmc=26892847; bbsessionhash=0d7cdd74637b9f503c4f33d7ad1f8394
>
> HTTP/1.1 200 OK
> Server: nginx/1.0.10
> Date: Fri, 16 Dec 2011 14:08:43 GMT
> Content-Type: image/jpeg
> Connection: keep-alive
> Expires: Wed, 14 Dec 2011 14:59:21 GMT
> Last-Modified: Tue, 13 Dec 2011 06:16:41 GMT
> Cache-Control: max-age=600
> Content-Length: 18419

Note:
Expires < Date + Cache-Control max-age.

The difference is about 2 days, so it looks like
proxy_ignore_headers works as it should.

I suppose previously you've looked at files cached without
proxy_ignore_headers in config. Note that changing config isn't
enough to get longer cache valid times for already cached
responses, since validity time is calculated while obtaining
response from a backend. A response have to be recached with the
new settings.

A side note: you may want to hide or change Expires header to
make sure clients will be able to cache responses. This may be
done either with proxy_hide_header or with "expires" directive.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_ignore_headers doesn't seem to work

piotr December 14, 2011 11:34AM

Re: proxy_ignore_headers doesn't seem to work

Maxim Dounin December 14, 2011 12:10PM

Re: proxy_ignore_headers doesn't seem to work

piotr December 16, 2011 09:11AM

Re: proxy_ignore_headers doesn't seem to work

Maxim Dounin December 18, 2011 06:18AM

Re: proxy_ignore_headers doesn't seem to work

piotr January 04, 2012 03:12PM

Re: proxy_ignore_headers doesn't seem to work

Francis Daly January 04, 2012 05:28PM

Re: proxy_ignore_headers doesn't seem to work

Francis Daly January 04, 2012 06:14PM

Re: proxy_ignore_headers doesn't seem to work

Maxim Dounin January 04, 2012 10:20PM

Re: proxy_ignore_headers doesn't seem to work

piotr January 09, 2012 01:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready