We have various pictures associated with items on our site but not for all of them. To this end we would like to display the contents of 'blank.jpg' if a given image is not found.
To this end we have the nginx config like this
location /static/images/ {
root /blah_blah_blah/pictures/;
error_page 404 blank.jpg;
break;
}
The problems with this is that this takes /static/images/fred.jpg and redirects to /static/images/blank.jpg when what we want is to simply display the contents of blank.jpg whilst keeping the /static/images/fred.jpg url
It also seems to go into a redirect loop occasionally.
Not sure if you still need it 10 month later but this looks like what you were looking for: https://serverfault.com/questions/562269/redirect-missing-images-in-a-specific-directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With