From 11ccc12d4a922dfaf682b8b744c2ba18016e67b3 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 26 Dec 2022 17:54:56 -0800 Subject: [PATCH] Always proxy websockets --- config | 1 - config-AlmaLinux-7.0-ALL | 1 - config-CentOS-Linux-7.0-ALL | 1 - config-CentOS-Stream-Linux-8.0-ALL | 1 - config-Oracle-Linux-8.0-ALL | 1 - config-Redhat-Enterprise-Linux-7.0-ALL | 1 - config-Rocky-Linux-7.0-ALL | 1 - config-Scientific-Linux-7.0-ALL | 1 - config-Ubuntu-Linux-18.04-ALL | 1 - config-debian-linux | 1 - config-debian-linux-10.0-ALL | 1 - config-redhat-linux | 1 - config.info | 1 - virtual_feature.pl | 24 +++++++++++------------- 14 files changed, 11 insertions(+), 26 deletions(-) diff --git a/config b/config index 46bd0a4..3c74f32 100644 --- a/config +++ b/config @@ -6,4 +6,3 @@ apply_cmd=killall nginx ; sleep 1 ; /usr/local/nginx/sbin/nginx >/dev/null 2>&1 child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-AlmaLinux-7.0-ALL b/config-AlmaLinux-7.0-ALL index e4e8505..8bd4f03 100644 --- a/config-AlmaLinux-7.0-ALL +++ b/config-AlmaLinux-7.0-ALL @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-CentOS-Linux-7.0-ALL b/config-CentOS-Linux-7.0-ALL index e4e8505..8bd4f03 100644 --- a/config-CentOS-Linux-7.0-ALL +++ b/config-CentOS-Linux-7.0-ALL @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-CentOS-Stream-Linux-8.0-ALL b/config-CentOS-Stream-Linux-8.0-ALL index e4e8505..8bd4f03 100644 --- a/config-CentOS-Stream-Linux-8.0-ALL +++ b/config-CentOS-Stream-Linux-8.0-ALL @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-Oracle-Linux-8.0-ALL b/config-Oracle-Linux-8.0-ALL index e4e8505..8bd4f03 100644 --- a/config-Oracle-Linux-8.0-ALL +++ b/config-Oracle-Linux-8.0-ALL @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-Redhat-Enterprise-Linux-7.0-ALL b/config-Redhat-Enterprise-Linux-7.0-ALL index e4e8505..8bd4f03 100644 --- a/config-Redhat-Enterprise-Linux-7.0-ALL +++ b/config-Redhat-Enterprise-Linux-7.0-ALL @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-Rocky-Linux-7.0-ALL b/config-Rocky-Linux-7.0-ALL index e4e8505..8bd4f03 100644 --- a/config-Rocky-Linux-7.0-ALL +++ b/config-Rocky-Linux-7.0-ALL @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-Scientific-Linux-7.0-ALL b/config-Scientific-Linux-7.0-ALL index 142f157..30187de 100644 --- a/config-Scientific-Linux-7.0-ALL +++ b/config-Scientific-Linux-7.0-ALL @@ -6,4 +6,3 @@ apply_cmd=service nginx restart child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-Ubuntu-Linux-18.04-ALL b/config-Ubuntu-Linux-18.04-ALL index c72da22..351a6d9 100644 --- a/config-Ubuntu-Linux-18.04-ALL +++ b/config-Ubuntu-Linux-18.04-ALL @@ -8,4 +8,3 @@ add_link=/etc/nginx/sites-enabled child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-debian-linux b/config-debian-linux index c72da22..351a6d9 100644 --- a/config-debian-linux +++ b/config-debian-linux @@ -8,4 +8,3 @@ add_link=/etc/nginx/sites-enabled child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-debian-linux-10.0-ALL b/config-debian-linux-10.0-ALL index c72da22..351a6d9 100644 --- a/config-debian-linux-10.0-ALL +++ b/config-debian-linux-10.0-ALL @@ -8,4 +8,3 @@ add_link=/etc/nginx/sites-enabled child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config-redhat-linux b/config-redhat-linux index e4e8505..8bd4f03 100644 --- a/config-redhat-linux +++ b/config-redhat-linux @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx child_procs=4 php_socket=1 listen_mode=1 -proxy_websockets=0 diff --git a/config.info b/config.info index a89d34b..5139d87 100644 --- a/config.info +++ b/config.info @@ -9,4 +9,3 @@ rotate_cmd=Command to re-open all log files,3,Just use apply command child_procs=Default number of PHP child processes,3,Virtualmin default extra_dirs=Additional Nginx directives for new virtual hosts,9,80,5,\t listen_mode=Add IP addresses to listen directives?,1,1-Yes,0-No -proxy_websockets=Add proxy websockets connections?,1,1-Yes,0-No diff --git a/virtual_feature.pl b/virtual_feature.pl index 4594133..5fe2762 100644 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -1992,19 +1992,17 @@ sub feature_create_web_balancer 'words' => [ $url ], }, ); - if ($config{'proxy_websockets'}) { - # Add directives to proxy websockets - push(@{$l->{'members'}}, - { 'name' => 'proxy_http_version', - 'words' => [ '1.1' ], }, - { 'name' => 'proxy_set_header', - 'words' => [ 'Upgrade', '$http_upgrade' ], }, - { 'name' => 'proxy_set_header', - 'words' => [ 'Connection', 'Upgrade' ], }, - { 'name' => 'proxy_set_header', - 'words' => [ 'Host', '$host' ], }, - ); - } + # Add directives to proxy websockets + push(@{$l->{'members'}}, + { 'name' => 'proxy_http_version', + 'words' => [ '1.1' ], }, + { 'name' => 'proxy_set_header', + 'words' => [ 'Upgrade', '$http_upgrade' ], }, + { 'name' => 'proxy_set_header', + 'words' => [ 'Connection', 'Upgrade' ], }, + { 'name' => 'proxy_set_header', + 'words' => [ 'Host', '$host' ], }, + ); } $balancer->{'location'} = $l; my $before = &find_before_location($server, $balancer->{'path'});