0

In case of an image (png,jpg,gif) missing thus giving a 404 error, I would like Nginx to send back a fallback image e.g. https://example.com/fallback.png

I tried the following with no success

location ~* ^/[^/]*/(.*)\.(gif|jpe?g|png)$ {
   try_files $uri https://example.com/fallback.png =404;
}

Any help would be most appreciated.

0 Answers0