I'm using Rails 3.2 with passenger+nginx. I want to display nice custom 500 page when the db server is down. I want to show something when my rails app cannot be started. Here is my nginx:
server {
listen 80;
server_name localhost;
root /var/www/store/public;
error_page 500 /500.html;
# root
location / {
passenger_enabled on;
rails_env production;
passenger_use_global_queue on;
}
}
The above configuration doesn't work at all. When it happens, it shows only:
Internal Server Error (500)
Any idea?
Phusion Passenger author here. Use passenger_intercept_errors off.
from the passenger documentation http://www.modrails.com/documentation/Users%20guide%20Nginx.html#PassengerFriendlyErrorPages
passenger_friendly_error_pages off
Which can be placed inside the http block, server block or location block, will not show the passenger error for startup failures and I believe link to the nginx supplied 500 error page.
mariow's link led me to the answer. The error files are in the templates folder. I use rvm, so my templates folder is at /home/forest.handford/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/resources/templates/
. Use find / -name templates | grep passenger
to find yours. I'm changing undisclosed_error.html.template
for my site, as it is the error that occurs when people type an invalid URL .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With