diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 4ef24bcfc..d55c1c9f4 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 425b52555..daad3ba2b 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -8,7 +8,11 @@ reuse, SSL offload and HTTP media streaming. Plugin Changelog ================ -1.4 +1.5 + +* Add proxy options for ignore client abort and disabling buffering + +1.4 (Development only) * move upstreams from HTTP to their own menu because they are used for TCP load balancing as well * add TCP load balancing [1] 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 4072d2665..70f4572eb 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 @@ -223,11 +223,37 @@ true If you enable the honeypot, all requests to this location will go to a special temporary log which will be used to block the IP. This is dangerous because you may accidentally block legitimate users or search engines. The result is available as a special alias in the firewall section. For example you can trigger on locations of Wordpress for phpMyAdmin if you are not using it. + + header + + true + location.websocket - + + checkbox + true + If you enable the WebSocket Support option, nginx will pass the upgrade header to the backed server. + + + location.proxy_buffering + + checkbox + true + If you enable the Response Buffering option, nginx will buffer response from the backed server. + + + location.proxy_request_buffering + checkbox true If you enable the WebSocket option, nginx will pass the upgrade header to the backed server. + + location.proxy_ignore_client_abort + + checkbox + true + If you enable this option, nginx will not terminate the connection to the backend server if the client connection is terminated. + 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 270fe1dfc..8458931bc 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 @@ -1,6 +1,6 @@ //OPNsense/Nginx - 1.1.3 + 1.5.0 nginx web server, reverse proxy and waf @@ -348,6 +348,18 @@ Y 0 + + Y + 0 + + + Y + 1 + + + Y + 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 fcf496c37..d690e4028 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf @@ -135,6 +135,9 @@ location {{ location.matchtype }} {{ location.urlpattern }} { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + 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 %}; {% if location.path_prefix is defined and location.path_prefix != '' %} proxy_pass http{% if upstream.tls_enable == '1' %}s{% endif %}://upstream{{ location.upstream.replace('-','') }}{{ location.path_prefix }}; {% else %}