Check for existing remote files

Reinis Rozitis r at
Thu Jan 13 13:51:00 MSK 2011

> how can i check or

Well it depends what yout want to do after checking if the file does or 
doesnt exist.

If you just want to serve the remote file and fall back to some backup 
location/host you can technically use proxy_pass (define 2 or more upstream 
( ) servers which to check first 
(your own you can define as 'backup')) with proxy_next_upstream http_404; 
option ( ).

For something more sophiscated scenario you would need to write either perl 
module or just rewrite the requests to a php script for example.


More information about the nginx mailing list