Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to set up nginx so that when a timeout occurs attempting to reach the upstream proxy, that it will just return the cached version on disk.

Can someone tell me how, as the docs are a little sparse on information.

share|improve this question
The question is: where this cached version on the disk came from? – Alexander Azarov May 27 '10 at 15:50
From a previously good request. – Glen Solsberry May 27 '10 at 16:41
up vote 1 down vote accepted

proxy_cache_use_stale timeout;

to serve stale objects in case the upstream goes timeout and

proxy_connect_timeout 40;

to control the timeout...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.