Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Looking for jpg resource in other folder with location settings

$
0
0
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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>