I would like to know if I can conditionally serve a specific file as a 404 page based on the request url, or the content-type/mime-type requested.
I'm guess something along the lines of:
if url_extention == (gif|jpg|png):
/404.gif
else:
/404.html
I am not too familiar with NGINX 404/url rewrites.
At the moment, I have:
server
{
listen 80;
server_name static.example.com;
access_log off;
location / {
root /warehouse/web/static/static.example.com;
expires 3d;
error_page 404 = /404.gif;
}
location /404.gif {
root /warehouse/web/static/404;
}
}