mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 06:32:11 -05:00
for use when we don't want API to serve any traffic, but paas is still
running. It's a simple nginx_buildpack app that is pushed separately,
and then two makefile commands that toggle the routes (and also
stop/start the nginx app).
For all endpoints/methods it returns a 503, with the response body.
```
{
"status_code": 503,
"errors": [
{
"error": "PlannedMaintenanceError",
"message": "We’re performing some essential updates. Notify will be back shortly. Please check https://status.notifications.service.gov.uk/ for more details"
}
]
}
```
NB: If you hit `/` it'll still return 404 - as this is defined in the
paas-proxy instance on aws.
32 lines
899 B
Nginx Configuration File
32 lines
899 B
Nginx Configuration File
worker_processes 1;
|
||
daemon off;
|
||
|
||
error_log ./error.log;
|
||
events { worker_connections 8192; }
|
||
|
||
http {
|
||
charset utf-8;
|
||
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
|
||
access_log ./access.log cloudfoundry;
|
||
|
||
keepalive_timeout 30;
|
||
server_tokens off;
|
||
|
||
server {
|
||
listen {{port}};
|
||
server_name localhost;
|
||
|
||
location / {
|
||
set $RESP '{';
|
||
set $RESP '${RESP} "status_code": 503,';
|
||
set $RESP '${RESP} "errors": [ {';
|
||
set $RESP '${RESP} "error": "PlannedMaintenanceError",';
|
||
set $RESP '${RESP} "message": "We’re performing some essential updates. Notify will be back shortly. Please check https://status.notifications.service.gov.uk/ for more details"';
|
||
set $RESP '${RESP} } ] }';
|
||
|
||
add_header Content-Type application/json;
|
||
return 503 '$RESP';
|
||
}
|
||
}
|
||
}
|