Re: nginx with proxy_cache_use_stale not returning from cache when connection refused

2014-12-11 Thread new299
After adding the following: proxy_cache_valid 200 302 301 10m; It appears to be working. It's unclear to me why: proxy_cache_valid any 10m; Wasn't working, for me. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,255408,255441#msg-255441 __

Re: nginx with proxy_cache_use_stale not returning from cache when connection refused

2014-12-11 Thread new299
Thanks, I've tried this. My amended configuration is below. However, I'm still getting the same error when the upstream goes away. The cache directory is now being populated correctly however. Any ideas? -- user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_co

Re: nginx with proxy_cache_use_stale not returning from cache when connection refused

2014-12-10 Thread new299
When the upstream goes away nginx gives the error "502 Bad Gateway nginx/1.4.6 (Ubuntu)". The log contains: " [error] 2624#0: *48941 connect() failed (111: Connection refused) while connecting to upstream," Rather than serving it from cache as I would expect. It should be cached as the page was p

nginx with proxy_cache_use_stale not returning from cache when connection refused

2014-12-10 Thread new299
Hi, I'm using nginx as a reverse proxy, but I can't get nginx to serve requests from its cache when the upstream server is refusing connections. I understood that "proxy_cache_use_stale error" should allow me to do this, but it doesn't seem to work for me. Have I perhaps misunderstood something?