-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1252 from GSA/maintenance-page
Maintenance page
- Loading branch information
Showing
7 changed files
with
864 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## This will put the site into maintenance mode depending on the environment variable. | ||
|
||
# $operation_mode is set from {{env "CATALOG_WEB_MODE"}} or {{env "CATALOG_ADMIN_MODE"}} | ||
# from previous nginx configuration | ||
# it is '' if the environment variable is not set | ||
set $takedown "0"; | ||
if ($operation_mode = 'MAINTENANCE') { | ||
set $takedown "1"; | ||
} | ||
if ($operation_mode = 'DOWN') { | ||
set $takedown "2"; | ||
} | ||
# Allow access to the following paths | ||
if ($uri = "/api/action/status_show") { | ||
set $takedown "0"; | ||
} | ||
if ($uri = "/user/saml2login") { | ||
set $takedown "0"; | ||
} | ||
if ($uri ~* "/static-assets/") { | ||
set $takedown "0"; | ||
} | ||
|
||
if ($takedown != "0") { | ||
return 503; | ||
} | ||
error_page 503 @maintenance; | ||
location @maintenance { | ||
if ($takedown = "1") { | ||
rewrite ^(.*)$ /maintenance.html break; | ||
} | ||
if ($takedown = "2") { | ||
rewrite ^(.*)$ /sitedown.html break; | ||
} | ||
rewrite ^(.*)$ /500.html break; | ||
} | ||
location = /maintenance.html { | ||
root ./public; | ||
} | ||
location = /sitedown.html { | ||
root ./public; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.