Custom error page issues

If your custom 404 page doesn’t work or stops working on Nginx, it might be missing the declaration in the config file for your site.

I have just found that adding the following line in the primary server block for mine made it work (somewhere between the root line and the location block worked for me):

error_page 404 /404.html;

So for example, those lines on mine look something like:

image

I imagine if you wanted to make additional error pages for different errors codes, you could probably add lines with 404 and the file name substituted.