passenger_friendly_error_pages off

605 views
Skip to first unread message

james

unread,
Jun 28, 2011, 7:43:24 PM6/28/11
to Phusion Passenger Discussions
hi.

I want to disable to passenger_friendly_error_pages in production
because it is ugly for users to see the passenger exception default
should some bad code creep into production.

However, if I set this up all I get instead is a page with an h1 of
'Internal Server Error (500)'

The error_page setup does not seem to be being used. This is maybe
because the rails app raised an exception on load but nevertheless I
would have thought it still possible to serve the static error pages
from my app/public folder

I'm using nginx and here is my conf:

server {
listen <MY_PORT>;
server_name <MY_IP>;
passenger_friendly_error_pages off;
location / {
root /route/to/my/rails/app/public;
passenger_enabled on;
rails_spawn_method smart;
}
error_page 404 /404.html;
location = /404.html {
root /route/to/my/rails/app/public;
}

error_page 422 /422.html;
location = /422.html {
root /route/to/my/rails/app/public;
}

error_page 503 /503.html;
location = /503.html {
root /route/to/my/rails/app/public;
}

error_page 500 502 504 /500.html;
location = /500.html {
root /route/to/my/rails/app/public;
}
}

I tried to grep for the file that serves:
<h1>Internal Server Error (500)</h1>

however I think it is dynamically generated? otherwise I could just
symlink it to my rails error page.

Anyway - anything obviously wrong with my conf here?

Note: The error pages do work if the rails app is sucesssful in
loading - this is the case where there is an exception in
environment.rb say.

Thanks

Hongli Lai

unread,
Aug 2, 2011, 9:51:20 AM8/2/11
to phusion-...@googlegroups.com

It's hardcoded in ext/nginx/HelperServer.cpp. As an alternative, you
can turn friendly error pages on, but modify the templates in
lib/phusion_passenger/templates.

--
Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

James O'Brien

unread,
Aug 2, 2011, 1:28:42 PM8/2/11
to phusion-...@googlegroups.com
Thanks,

I think an additional sister option for passenger_friendly_error_pages to declare the content to show would be very useful. Editing the standard template doesn't seem ideal.

Thanks again.
J


--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To post to this group, send email to phusion-...@googlegroups.com.
To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.


Reply all
Reply to author
Forward
0 new messages