Answer the question
In order to leave comments, you need to log in
Nginx location - auto-substitute another image in the absence of the requested image?
There is a set of pictures located on the server at:
/var/www/site.com/web/images/storage/icons/ИКАНОКА.png
https://site.com/images/storage/icons/TEST1.png
https://site.com/images/storage/icons/TEST1.png
https://site.com/images/storage/icons/TEST1.gif
/images/storage/icons/_NULL.png
location ^~ /images/storage/icons/([a-zA-Z0-9]{1,9})\.(gif|png)$ {
try_files $uri /images/storage/icons/$1.png /images/storage/icons/$1.gif /images/storage/icons/_NULL.gif =404;
}
location ^~ /images/storage/icons/([a-zA-Z0-9]{1,9})\.(gif|png)$ {
try_files $uri /var/www/site.com/web/images/storage/icons/$1.png /var/www/site.com/web/images/storage/icons/$1.gif /var/www/site.com/web/images/storage/icons/_NULL.gif =404;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question