I ran into this today. It seems the issue is due to nginx (like most servers) not letting you POST
to a static file.
The solution is to capture 405 errors in your @503 location block, serving the maintenance page. In addition, you will have to enable @recursiveerrorpages@, since you are first, intentionally, throwing a 503 error, and then the user is throwing a 405 by posting to your static file:
recursive_error_pages on;
if (-f $document_root/system/maintenance.html) {
return 503;
}
error_page 404 /404.html;
error_page 500 502 504 /500.html;
error_page 503 @503;
location @503 {
error_page 405 = /system/maintenance.html;
# Serve static assets if found.
if (-f $request_filename) {
break;
}
rewrite ^(.*)$ /system/maintenance.html break;
}
Source: https://www.onehub.com/blog/2009/03/06/rails-maintenance-pages-done-right/