Nginx – How to Configure Global Error Page

errordocumentnginx

Is it possible to configure globally only the http part of nginx.conf to have all sites using the same error pages, without having to add some lines to each of the sites?

I'm not talking about the error page configuration per site.
Also not talking about having the same error page shared among multiple/all sites, using aliases.

The problem with these solutions is that it requires a configuration setup per site.

Best Answer

According to nginx documentation error_page directive is allowed in following locations: http, server, location, if in location.

Related Topic