Commit 8724f1c4 authored by Otheus Shelling's avatar Otheus Shelling 😀
Browse files

SORRY.incl : import from nuxeo host

parent 79048b07
## "SORRY" SERVER
##
## Otheus - 2016-10-18
##
## If /etc/httpd/MAINTENANCE exists,
## Then for ALL Requests, return 503 and content of /var/www/html/sorry/503.html
## UNLESS request IP/host is in /etc/httpd/maintenance-bypass-hosts.txt
##
## To disable, simply remove/rename /etc/httpd/MAINTENANCE file.
## (but don't remove the bypass-hosts file, or server will fail to start)
##
## To use: include this file in each virtualhost
RewriteEngine On
## Restart server if you change this
RewriteMap hosts-bypass-maint "txt:/etc/httpd/maintenance-bypass-hosts.txt"
# IF not in maintenance, skip 3 rules
RewriteCond "/var/www/MAINTENANCE" !-f
RewriteRule ^ - [S=3]
# IF one of the excluded hosts, skip 2 rules
RewriteCond "${hosts-bypass-maint:%{REMOTE_ADDR}|%}" "!=%"
RewriteRule ^ - [S=2]
# IF not already being redirected due to 503, redirect
# with a 503 status and to appropriate page.
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteRule ^(.*)$ /$1 [L,R=503]
# No more rewrite rules in this path (prevents HTTPS redirection or other redirects)
RewriteRule ^ - [L]
#LogLevel rewrite:trace5
ErrorDocument 503 /sorry/503.html
<Directory /var/www/html/sorry>
Require all granted
</Directory>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment