In testing Passenger 5.1, I found that setting passenger_friendly_error_pages off
is not enough to change the default error page. This disables exposing backtrace or environment variables but still shows Passenger's error page.
To resolve this I had to set the following:
passenger_intercept_errors on;
error_page 500 /500.html;
The command passenger_intercept_errors
tells nginx to handle status codes of 400 or higher. The error_page
command customizes the error. You might want to customize other errors as well.
For a Rails app, the location of the pages is relative to the public
folder of the app (what you set in the root
command for nginx).
As mentioned is this comment, the similar configuration for Apache is:
PassengerErrorOverride on
ErrorDocument 500 /path/to/500.html