When testing Passenger 5.1, I found that setting passenger_friendly_error_pages off not enough to change the default error page. This disables the exposure of backtrace or environment variables, but still shows the Passenger error page.
To solve this problem, I had to install the following:
passenger_intercept_errors on; error_page 500 /500.html;
The passenger_intercept_errors command tells nginx to process status codes 400 or higher. The error_page command configures the error. You can also configure other errors.
For a Rails application, the page layout refers to the public folder of the application (which you set in the root command for nginx).
As already mentioned, this comment is a similar configuration for Apache:
PassengerErrorOverride on ErrorDocument 500 /path/to/500.html
source share