Welcome! Log In Create A New Profile

Advanced

Re: Nginx X-Accel-Redirect stripping Content-Encoding header

June 28, 2013 08:29AM
> Something like this should work:
>
> location /files/ {
> internal;
> add_header Content-Encoding $upstream_http_content_encoding;
> }

Thanks yep that worked.

> This might not work well with nginx gzip filter though.

And yes, I had to turn gzip off for the internal location used for x-accel-redirect, otherwise it was setting the Content-Encoding header twice.


> Better solution might be to just return X-Accel-Redirect to an
> uncompressed file, and use gzip_static to serve precompressed
> files if they are available and supported by a client, see
> http://nginx.org/r/gzip_static.

Thanks for the tip.

cheers
Dan
SubjectAuthorPosted

Nginx X-Accel-Redirect stripping Content-Encoding header

DanackJune 28, 2013 06:21AM

Re: Nginx X-Accel-Redirect stripping Content-Encoding header

Maxim DouninJune 28, 2013 06:40AM

Re: Nginx X-Accel-Redirect stripping Content-Encoding header

DanackJune 28, 2013 08:29AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 97
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready