proxy_pass_header not working in 1.6.0
Maxim Dounin
mdounin at mdounin.ru
Tue Jul 1 12:16:55 UTC 2014
Hello!
On Tue, Jul 01, 2014 at 01:00:05PM +0200, Lucas Rolff wrote:
> nginx:
>
> curl -I http://domain.com/wp-content/uploads/2012/05/forside.png
> HTTP/1.1 200 OK
> Server: nginx
> Date: Tue, 01 Jul 2014 10:42:06 GMT
> Content-Type: image/png
> Content-Length: 87032
> Last-Modified: Fri, 08 Mar 2013 08:02:48 GMT
> Connection: keep-alive
> Vary: Accept-Encoding
> ETag: "51399b28-153f8"
> Accept-Ranges: bytes
>
> Backend:
>
> curl -I http://domain.com:8081/wp-content/uploads/2012/05/forside.png
> HTTP/1.1 200 OK
> Date: Tue, 01 Jul 2014 10:42:30 GMT
> Server: Apache
> Last-Modified: Fri, 08 Mar 2013 08:02:48 GMT
> Accept-Ranges: bytes
> Content-Length: 87032
> Cache-Control: max-age=2592000
> Expires: Thu, 31 Jul 2014 10:42:30 GMT
> Content-Type: image/png
>
> So backend returns the headers just fine.
The response returned by nginx is a static file served by nginx
itself. Note the ETag header returned, and the "location
~*.*\.(3gp|gif|jpg|jpeg|png|..." in your config - it looks like
the file exists on the filesystem, and returned directly as per
configuration. There is no surprise the response doesn't have any
headers which are normally returned by your backend.
(And yes, all proxy_pass_header directives in your config are
meaningless and should be removed.)
--
Maxim Dounin
http://nginx.org/
More information about the nginx
mailing list