Welcome! Log In Create A New Profile

Advanced

Caching not working

Jeff Mitchell
May 14, 2012 09:26PM
Hello,

I'm running nginx 1.0.15. I have the following in my http block:

proxy_cache_path /var/tmp/nginx/proxy/cache/quickgit levels=1:2
keys_zone=quickgit:200m;
proxy_temp_path /var/tmp/nginx/proxy/temp;

and in my server block I have (among some other things):

index index.php;

error_page 418 = @feed;

if ( $args ~ a=atom ) {
return 418;
}
if ( $args ~ a=rss ) {
return 418;
}

location @feed {
include /etc/nginx/fastcgi_params;

proxy_cache quickgit;
proxy_hide_header Set-Cookie;
proxy_cache_key "$scheme$host$request_uri";
proxy_cache_use_stale error timeout invalid_header updating;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
proxy_cache_valid any 1m;
proxy_ignore_headers X-Accel-Redirect X-Accel-Expires Expires
Cache-Control Set-Cookie;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_read_timeout 300;
fastcgi_send_timeout 300;
}

I know that the @feed location is being hit at the appropriate time
because if I put a "return 404" in there I get a 404 page when accessing
the atom/rss URLs. Additionally, nginx creates the correct directories
under /var/tmp/nginx/proxy. However, nothing shows up in the
cache...I've tried tweaking all sorts of parameters (including the
proxy_ignore_headers, even though I only see Set-Cookie coming from the
backend) but nothing has helped.

Thanks in advance,
Jeff

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

Caching not working

Jeff Mitchell May 14, 2012 09:26PM

Re: Caching not working

Maxim Dounin May 15, 2012 05:40AM

Re: Caching not working

Jeff Mitchell May 15, 2012 02:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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