From e86f9e6e0ecede42d577a052077c211ad5907ac0 Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Sun, 9 Jun 2019 12:31:24 +0200 Subject: [PATCH 1/2] www/nginx: Release note --- www/nginx/Makefile | 2 +- www/nginx/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 03adf3887..8950c628d 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.13 +PLUGIN_VERSION= 1.14 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 db8f5dd8a..285368171 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -8,6 +8,10 @@ reuse, SSL offload and HTTP media streaming. Plugin Changelog ================ +1.14 + +* add load balancer algorithm option (ip_hash) + 1.13 * add support for 0-RTT (Early Data in TLS 1.3) From f91d44f43d9c80654afdf126e5d0f85d0a8380f8 Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Sun, 9 Jun 2019 12:33:35 +0200 Subject: [PATCH 2/2] www/nginx: support for ip_hash option --- .../mvc/app/controllers/OPNsense/Nginx/forms/upstream.xml | 6 ++++++ .../src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 7 +++++++ .../service/templates/OPNsense/Nginx/upstream.conf | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/upstream.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/upstream.xml index 6a9bf5905..65ba0b573 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/upstream.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/upstream.xml @@ -10,6 +10,12 @@ select_multiple + + upstream.load_balancing_algorithm + + + dropdown + upstream.proxy_protocol 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 c4d108a23..446692207 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 @@ -82,6 +82,13 @@ Y Y + + + IP Hash + + Weighted Round Robin + N + 0 Y diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf index 2076809e3..b5226fa90 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf @@ -7,6 +7,11 @@ {% endfor %} {% for upstream_uuid, upstream in upstreamlist.items() %} upstream upstream{{ upstream_uuid.replace('-','') }} { +{% if upstream.load_balancing_algorithm is defined and upstream.load_balancing_algorithm != '' %} +{% if upstream.load_balancing_algorithm == 'ip_hash' %} +ip_hash; +{% endif %} +{% endif %} {% for upstream_serveruuid in upstream.serverentries.split(',') %} {% set upstream_server = helpers.getUUID(upstream_serveruuid) %} server {% if ':' in upstream_server.server %}[{% endif %}{{ upstream_server.server }}{% if ':' in upstream_server.server %}]{% endif