0
down vote
favorite
I have a general nginx rule to serve jpgs from they uri.
so if uri is "http://example.com/images/1.jpg it will server is form the root of the site/images/1.jpg
I want to try and serve the image from alternative path if not found on the original path. how do I write the 2nd location:
here is what I got:
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|ico)$ {
try_files $uri $uri/ @fallback;
access_log off;
expires max;
log_not_found off;
}
How do I write the fallback to look for the files in another location like /home/user/anotherfodler/ ?
Thanks
down vote
favorite
I have a general nginx rule to serve jpgs from they uri.
so if uri is "http://example.com/images/1.jpg it will server is form the root of the site/images/1.jpg
I want to try and serve the image from alternative path if not found on the original path. how do I write the 2nd location:
here is what I got:
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|ico)$ {
try_files $uri $uri/ @fallback;
access_log off;
expires max;
log_not_found off;
}
How do I write the fallback to look for the files in another location like /home/user/anotherfodler/ ?
Thanks