Welcome! Log In Create A New Profile

Advanced

Re: proxy_cache seems not working with X-Accel-Redirect

Maxim Dounin
August 16, 2013 10:34PM
Hello!

On Fri, Aug 09, 2013 at 06:20:21AM -0400, gray wrote:

> My config
>
> location ~ /cached/ {
> proxy_pass http://apache;
> proxy_cache cache;
> proxy_cache_valid 2h;
> proxy_cache_key "$host|$request_uri";
>
> }
>
> location /htdocs_internal/ {
> internal;
>
> alias $htdocs_path;
> }
>
> Requests with header in reply X-Accel-Redirect not cached, every time
> request is sent to apache. When i add these directives
> proxy_pass_header X-Accel-Redirect;
> proxy_ignore_headers X-Accel-Redirect;
> cache works fine (but is useless :) ), so it isn't problem with "no cache"
> headers from apache.

Yes, proxy_cache can't cache responses with X-Accel-Redirect.

As a workaround, you may use an additional proxy layer with
proxy_cache and proxy_ignore_headers X-Accel-Redirect +
proxy_pass_headers X-Accel-Redirect.

--
Maxim Dounin
http://nginx.org/en/donation.html

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

proxy_cache seems not working with X-Accel-Redirect

gray August 09, 2013 06:20AM

Re: proxy_cache seems not working with X-Accel-Redirect

Maxim Dounin August 16, 2013 10:34PM

Re: proxy_cache seems not working with X-Accel-Redirect

bdesemb January 11, 2017 07:39AM

Re: proxy_cache seems not working with X-Accel-Redirect

Maxim Dounin January 11, 2017 09:34AM

Re: proxy_cache seems not working with X-Accel-Redirect

bdesemb January 11, 2017 11:10AM

Re: proxy_cache seems not working with X-Accel-Redirect

bdesemb January 11, 2017 12:23PM

Re: proxy_cache seems not working with X-Accel-Redirect

Maxim Dounin January 11, 2017 12:44PM

Re: proxy_cache seems not working with X-Accel-Redirect

bdesemb January 12, 2017 07:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
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