Last Updated: March 22, 2017
·
497
· msz

Capistrano maintenance page with Rails, Nginx, and Passenger

I didn't like any of the instructions I found online on how to set up a maintenance page in Rails using Capistrano, Nginx and Passenger so I created my own based on Nginx documentation (http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files)

# Other server config
location / {
        try_files /system/maintenance.html @passenger;
}

location @passenger {
        passenger_enabled on;
}
# Even more config if you like...

The upside of this solution is that it doesn't require the 503 error page to be the same as the maintenance page.