Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #142 from RogerE/maintenance-nginx-config

Added Nginx configuration description for `deploy:web:disable`.
  • Loading branch information...
commit ad0422a6d077aecf207c39c4ada8c2128bac6a07 2 parents a66ea8d + 6bbbcc5
@leehambley leehambley authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/capistrano/recipes/deploy.rb
View
13 lib/capistrano/recipes/deploy.rb
@@ -542,7 +542,7 @@ def try_runner(*args)
warn <<-EOHTACCESS
- # Please add something like this to your site's htaccess to redirect users to the maintenance page.
+ # Please add something like this to your site's Apache htaccess to redirect users to the maintenance page.
# More Info: http://www.shiftcommathree.com/articles/make-your-rails-maintenance-page-respond-with-a-503
ErrorDocument 503 /system/#{maintenance_basename}.html
@@ -551,6 +551,17 @@ def try_runner(*args)
RewriteCond %{DOCUMENT_ROOT}/system/#{maintenance_basename}.html -f
RewriteCond %{SCRIPT_FILENAME} !#{maintenance_basename}.html
RewriteRule ^.*$ - [redirect=503,last]
+
+ # Or if you are using Nginx add this to your server config:
+
+ if (-f $document_root/system/maintenance.html) {
+ return 503;
+ }
+ error_page 503 @maintenance;
+ location @maintenance {
+ rewrite ^(.*)$ /system/maintenance.html last;
+ break;
+ }
EOHTACCESS
reason = ENV['REASON']
Please sign in to comment.
Something went wrong with that request. Please try again.