From 0186f548f8d116ce171179f602a659cd14211ae4 Mon Sep 17 00:00:00 2001 From: Fabian Franz BSc Date: Sun, 22 Mar 2020 11:02:45 +0100 Subject: [PATCH] www/nginx: SNI proxying (#1747) --- www/nginx/pkg-descr | 1 + .../app/controllers/OPNsense/Nginx/forms/location.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 6 +++++- .../service/templates/OPNsense/Nginx/location.conf | 9 +++++++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index a23083ed2..71fe052e5 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,6 +10,7 @@ Plugin Changelog 1.19 +* Add possibility to configure SNI proxying. * Display NAXSI rule ID in volt 1.18 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 b4b76dd60..05adce938 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 @@ -242,6 +242,13 @@ true Enter a custom timout between data received from the client after which the connection is closed. + + location.proxy_ssl_server_name + + checkbox + true + Check this box, if you want the client SNI header to be used instead of your backend hostname. This settings overrides the configured hostname in the upstream configuration. + location.proxy_buffer_size 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 06a471a39..f81fbcdcf 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.17.0 + 1.19.0 nginx web server, reverse proxy and waf @@ -460,6 +460,10 @@ N 0 + + 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 197cde8ce..b4482c537 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf @@ -174,9 +174,14 @@ location {{ location.matchtype }} {{ location.urlpattern }} { proxy_ssl_certificate_key /usr/local/etc/nginx/key/{{ upstream.tls_client_certificate }}.key; proxy_ssl_certificate /usr/local/etc/nginx/key/{{ upstream.tls_client_certificate }}.pem; {% endif %} -{% if upstream.tls_name_override is defined and upstream.tls_name_override != '' %} +{% if location.proxy_ssl_server_name is defined and location.proxy_ssl_server_name == '1' %} + proxy_ssl_server_name on; +{% else %} + proxy_ssl_server_name off; +{% if upstream.tls_name_override is defined and upstream.tls_name_override != '' %} proxy_ssl_name {{ upstream.tls_name_override }}; -{% endif %} +{% endif %} +{% endif%} {% if upstream.tls_protocol_versions is defined and upstream.tls_protocol_versions != '' %} proxy_ssl_protocols {{ upstream.tls_protocol_versions.replace(',', ' ') }}; {% endif %}