From 9a6558bca4113da7a1a1478cfe4b83d35882cc48 Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Wed, 27 Feb 2019 19:12:51 +0100 Subject: [PATCH] www/nginx: add proxy timeout support --- .../controllers/OPNsense/Nginx/forms/location.xml | 14 ++++++++++++++ .../mvc/app/models/OPNsense/Nginx/Nginx.xml | 8 ++++++++ .../service/templates/OPNsense/Nginx/location.conf | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml index 70f4572eb..b233467dc 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml @@ -235,6 +235,20 @@ true If you enable the WebSocket Support option, nginx will pass the upgrade header to the backed server. + + location.proxy_read_timeout + + text + true + Enter a custom timout between data received from the client after which the connection is closed. + + + location.proxy_send_timeout + + text + true + Enter a custom timout between data it sent to the client after which the connection is closed. + location.proxy_buffering diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index 106650659..eb2adfc3f 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -364,6 +364,14 @@ Y 1 + + N + 1 + + + N + 1 + Y 0 diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf index c08818cb8..91cb43247 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf @@ -139,6 +139,12 @@ location {{ location.matchtype }} {{ location.urlpattern }} { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-TLS-Client-Intercepted $tls_intercepted; +{% if location.proxy_read_timeout is defined and location.proxy_read_timeout != '' %} + proxy_read_timeout {{ location.proxy_read_timeout }}s; +{% endif %} +{% if location.proxy_send_timeout is defined and location.proxy_send_timeout != '' %} + proxy_send_timeout {{ location.proxy_send_timeout }}s; +{% endif %} proxy_ignore_client_abort {% if location.proxy_ignore_client_abort == '1' %}on{% else %}off{% endif %}; proxy_request_buffering {% if location.proxy_request_buffering == '1' %}on{% else %}off{% endif %}; proxy_buffering {% if location.proxy_buffering == '1' %}on{% else %}off{% endif %};