Check for existing remote files
r at roze.lv
Thu Jan 13 13:51:00 MSK 2011
> how can i check http://www.google.com/logo.png or
Well it depends what yout want to do after checking if the file does or
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
( http://wiki.nginx.org/HttpUpstreamModule ) servers which to check first
(your own you can define as 'backup')) with proxy_next_upstream http_404;
option ( http://wiki.nginx.org/HttpProxyModule#proxy_next_upstream ).
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