www/nginx: add fields for proxy server (#1011)

* www/nginx: add fields for proxy server
* www/nginx: fix typo
This commit is contained in:
Fabian Franz BSc
2018-11-24 10:07:23 +01:00
committed by GitHub
parent a66f6c97b4
commit 820b89ecd2
5 changed files with 49 additions and 4 deletions
+1 -1
View File
@@ -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
+5 -1
View File
@@ -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]
@@ -223,11 +223,37 @@
<advanced>true</advanced>
<help>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.</help>
</field>
<field>
<type>header</type>
<label>Advanced Proxy Options</label>
<advanced>true</advanced>
</field>
<field>
<id>location.websocket</id>
<label>WebSocket</label>
<label>WebSocket Support</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>If you enable the WebSocket Support option, nginx will pass the upgrade header to the backed server.</help>
</field>
<field>
<id>location.proxy_buffering</id>
<label>Response Buffering</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>If you enable the Response Buffering option, nginx will buffer response from the backed server.</help>
</field>
<field>
<id>location.proxy_request_buffering</id>
<label>Request Buffering</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>If you enable the WebSocket option, nginx will pass the upgrade header to the backed server.</help>
</field>
<field>
<id>location.proxy_ignore_client_abort</id>
<label>Ignore Client Abort</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>If you enable this option, nginx will not terminate the connection to the backend server if the client connection is terminated.</help>
</field>
</form>
@@ -1,6 +1,6 @@
<model>
<mount>//OPNsense/Nginx</mount>
<version>1.1.3</version>
<version>1.5.0</version>
<description>nginx web server, reverse proxy and waf</description>
<items>
<general>
@@ -348,6 +348,18 @@
<Required>Y</Required>
<default>0</default>
</websocket>
<proxy_ignore_client_abort type="BooleanField">
<Required>Y</Required>
<default>0</default>
</proxy_ignore_client_abort>
<proxy_request_buffering type="BooleanField">
<Required>Y</Required>
<default>1</default>
</proxy_request_buffering>
<proxy_buffering type="BooleanField">
<Required>Y</Required>
<default>1</default>
</proxy_buffering>
<http2_push_preload type="BooleanField">
<Required>Y</Required>
<default>0</default>
@@ -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 %}