Hello everyone,
We've been having a problem where the Passenger friendly error page is not showing up despite `passenger_friendly_error_pages on` being set in the nginx config.
We're running Rails 4.2.8, Ruby 2.4.1, nginx 1.10.3 compiled with Passenger 5.1.5 from the APT repository.
nginx.conf
user user_name;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_names_hash_bucket_size 64;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /etc/nginx/ruby_wrapper;
passenger_friendly_error_pages on;
include /etc/nginx/sites-enabled/*;
}
The ruby_wrapper program just exports some environment variables and sources RVM's Ruby wrapper, and I've tried using the RVM wrapper directly and encountered the same problem, so that part has been ruled out.
The single sites-enabled file has
passenger_max_pool_size 6;
passenger_start_timeout 180;
set, and then defines a port 80 server that redirects to https, and a 443 server with ssl turned on and a `passenger_enabled on;` directive.
We haven't set a passenger_app_env anywhere, relying on it's default to `production`.
Thinking of things that might be causing the error, the root of the rails repository has a file called public/500.html, and this is indeed the file that is being loaded when Passenger hits a 500 error in the application. Removing this file lead to a plain 500 error with no content being returned at all.
Any help would be appreciated!
Thanks,
Gerard