Customized error pages for 500.

Jack D. lists at
Fri Jan 10 00:19:11 UTC 2014

Igor Sysoev wrote in post #928721:

>          error_page 500 502 503 504 /500.html;
>          location = /500.html {
>          }
>     }

I would like to clarify what's going on in these two lines of Igor's

A. Note the "/500.html" part on the first line. That is not a variable
of any sort, but rather means that Nginx is expecting there to be a file
named 500.html in your root. In some examples you will see "/50x.html"
used instead. In that case, there must be a file that is literally named
"50x.html" in your root. (The "x" is not to be mistaken for a variable)

B. Note the "location = /500.html" block down below. There is nothing in
this block, but it is crucial that this block exists or your custom
error page will not be displayed.

Posted via

More information about the nginx mailing list