diff --git a/playbooks/roles/nginx/defaults/main.yml b/playbooks/roles/nginx/defaults/main.yml index b480100..02f45f2 100644 --- a/playbooks/roles/nginx/defaults/main.yml +++ b/playbooks/roles/nginx/defaults/main.yml @@ -44,6 +44,13 @@ NGINX_LOG_FORMAT_NAME: 'p_combined' # headers to reflect the properties of the incoming request. NGINX_SET_X_FORWARDED_HEADERS: False +# Increasing these values allows studio to process more complex operations. +# Default timeouts limit CMS connections to 60 seconds. + +NGINX_CMS_PROXY_CONNECT_TIMEOUT: !!null +NGINX_CMS_PROXY_SEND_TIMEOUT: !!null +NGINX_CMS_PROXY_READ_TIMEOUT: !!null + NGINX_SERVER_ERROR_IMG: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Pendleton_Sinking_Ship.jpg/640px-Pendleton_Sinking_Ship.jpg' NGINX_SERVER_HTML_FILES: - file: rate-limit.html diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2 index 8d19daa..f7bc0cb 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2 @@ -104,6 +104,20 @@ error_page {{ k }} {{ v }}; proxy_redirect off; proxy_pass http://cms-backend; + + {{ NGINX_EDXAPP_CMS_APP_EXTRA }} + + {% if NGINX_CMS_PROXY_CONNECT_TIMEOUT %} + proxy_connect_timeout {{ NGINX_CMS_PROXY_CONNECT_TIMEOUT }}; + {% endif %} + {% if NGINX_CMS_PROXY_SEND_TIMEOUT %} + proxy_send_timeout {{ NGINX_CMS_PROXY_SEND_TIMEOUT }}; + {% endif %} + {% if NGINX_CMS_PROXY_READ_TIMEOUT %} + proxy_read_timeout {{ NGINX_CMS_PROXY_READ_TIMEOUT }}; + {% endif %} + + {{ NGINX_EDXAPP_CMS_APP_EXTRA }} } location / {