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 @@
trueEnter 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.0nginx web server, reverse proxy and waf
@@ -460,6 +460,10 @@
N0
+
+ 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 %}