Skip to content

Commit

Permalink
Always proxy websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Dec 27, 2022
1 parent 89324ff commit 11ccc12
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 26 deletions.
1 change: 0 additions & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion config-AlmaLinux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-CentOS-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-CentOS-Stream-Linux-8.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-Oracle-Linux-8.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-Redhat-Enterprise-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-Rocky-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-Scientific-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=service nginx restart
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-Ubuntu-Linux-18.04-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ add_link=/etc/nginx/sites-enabled
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-debian-linux
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ add_link=/etc/nginx/sites-enabled
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-debian-linux-10.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ add_link=/etc/nginx/sites-enabled
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config-redhat-linux
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=1
proxy_websockets=0
1 change: 0 additions & 1 deletion config.info
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tt>listen</tt> directives?,1,1-Yes,0-No
proxy_websockets=Add proxy websockets connections?,1,1-Yes,0-No
24 changes: 11 additions & 13 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
Expand Down

0 comments on commit 11ccc12

Please sign in to comment.