Commit c6c82f12 by Albert St. Aubin

Updated the NGINX configuration for IDAs to return a maintenance page

[LEARNER-4264]
parent 20f31389
- Role edx_django_service
- Added maintenance page under the flag EDX_DJANGO_SERVICE_ENABLE_S3_MAINTENANCE.
- Added the s3_maintenance.j2 file to point to the s3 maintenance page.
- Role: xqueue
- Added XQUEUE_MYSQL_CONN_MAX_AGE so that you can have xqueue use django's persistent DB connections
- Role: edxapp
- Added empty `EDXAPP_PASSWORD_COMPLEXITY` setting to ease overriding complexity.
......
......@@ -68,6 +68,10 @@ nginx_edx_django_service_gunicorn_hosts:
edx_django_service_hostname: '~^((stage|prod)-)?{{ edx_django_service_name }}.*'
edx_django_service_nginx_port: '1{{ edx_django_service_gunicorn_port }}'
EDX_DJANGO_SERVICE_ENABLE_S3_MAINTENANCE: true
EDX_DJANGO_SERVICE_S3_MAINTENANCE_FILE: "/edx-static/maintenance/maintenance.html"
edx_django_service_ssl_nginx_port: '4{{ edx_django_service_gunicorn_port }}'
edx_django_service_enable_basic_auth: false
edx_django_service_basic_auth_exempted_paths_default:
......
......@@ -30,6 +30,16 @@ default "null";
server {
server_name {{ edx_django_service_hostname }};
{% if EDX_DJANGO_SERVICE_ENABLE_S3_MAINTENANCE %}
# Do not include a 502 error in NGINX_ERROR_PAGES when
# EDX_DJANGO_SERVICE_ENABLE_S3_MAINTENANCE is enabled.
error_page 502 @maintenance;
{% include "s3_maintenance.j2" %}
{% endif %}
{% if NGINX_ENABLE_SSL %}
listen {{ edx_django_service_nginx_port }} {{ default_site }};
......
# This file was copied from playbooks/roles/nginx/templates/edx/app/nginx/sites-available/
# modifications should be made to both files if necessary.
{% if EDX_DJANGO_SERVICE_ENABLE_S3_MAINTENANCE %}
location @maintenance {
rewrite ^(.*) {{ EDX_DJANGO_SERVICE_S3_MAINTENANCE_FILE }} break;
proxy_http_version 1.1;
proxy_set_header Host s3.amazonaws.com;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_buffering off;
proxy_intercept_errors on;
proxy_pass https://s3.amazonaws.com;
}
{% endif %}
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