nginx

Nginx Catch-All Error Pages

Using a combination of named locations along with the error_page directive, we can make it so nginx automatically serves error pages from a directory structure with support for wildcard/catch-all files. For example the handler for status code 503 will check for /errors/error_503.html /errors/error_50x.html /errors/error_5xx.html /errors/error.html Creating the helper maps First off, we'll need to use the map directive to help us make the above lookup work. You will need to place these lines within the server block…

Keep reading