From 85aad09faeed6a0d01e5912571abe97d44857684 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Sat, 13 Mar 2021 16:13:54 +0300 Subject: [PATCH 1/4] HTTP/2 cannot be used with non-SSL site .. and will actually cause PHP files to be downloads in http --- virtual_feature.pl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/virtual_feature.pl b/virtual_feature.pl index af8e924..59c8cf0 100644 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -156,12 +156,11 @@ sub feature_setup 'words' => [ &domain_server_names($d) ] }); # Add listen on the correct IP and port - my @h2 = $config{'http2'} ? ( "http2" ) : ( ); if ($config{'listen_mode'}) { # Just use port numbers push(@{$server->{'members'}}, { 'name' => 'listen', - 'words' => [ $d->{'web_port'}, @h2 ] }); + 'words' => [ $d->{'web_port'} ] }); } else { # Use IP and port @@ -169,13 +168,12 @@ sub feature_setup : ':'.$d->{'web_port'}; push(@{$server->{'members'}}, { 'name' => 'listen', - 'words' => [ $d->{'ip'}.$portstr, @h2 ] }); + 'words' => [ $d->{'ip'}.$portstr ] }); if ($d->{'ip6'}) { push(@{$server->{'members'}}, { 'name' => 'listen', 'words' => [ '['.$d->{'ip6'}.']'.$portstr, - $d->{'virt6'} ? ( 'default' ) : ( ), - @h2 ] }); + $d->{'virt6'} ? ( 'default' ) : ( ) ] }); } } From 689c5e58f88410d97d7e5505a484481a2560dd93 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Sat, 13 Mar 2021 16:37:59 +0300 Subject: [PATCH 2/4] Fix listen mode logic --- config | 2 +- config-CentOS-Linux-7.0-ALL | 2 +- config-Redhat-Enterprise-Linux-7.0-ALL | 2 +- config-Scientific-Linux-7.0-ALL | 2 +- config-debian-linux | 2 +- config-redhat-linux | 2 +- virtual_feature.pl | 6 +++--- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config b/config index dc514e0..f53e3b4 100644 --- a/config +++ b/config @@ -5,5 +5,5 @@ stop_cmd=killall nginx apply_cmd=killall nginx ; sleep 1 ; /usr/local/nginx/sbin/nginx >/dev/null 2>&1 [ &domain_server_names($d) ] }); # Add listen on the correct IP and port - if ($config{'listen_mode'}) { + if ($config{'listen_mode'} eq '0') { # Just use port numbers push(@{$server->{'members'}}, { 'name' => 'listen', @@ -892,7 +892,7 @@ sub feature_validate $d->{'web_port'} == 80 || $l =~ /^\Q$d->{'ip'}\E:(\d+)$/ && $d->{'web_port'} == $1); - $found++ if ($l eq $d->{'web_port'} && $config{'listen_mode'}); + $found++ if ($l eq $d->{'web_port'} && $config{'listen_mode'} eq '0'); } $found || return &text('feat_evalidateip', $d->{'ip'}, $d->{'web_port'}); @@ -904,7 +904,7 @@ sub feature_validate $l =~ /^\[\Q$d->{'ip6'}\E\]:(\d+)$/ && $d->{'web_port'} == $1); $found6++ if ($l eq $d->{'web_port'} && - $config{'listen_mode'}); + $config{'listen_mode'} eq '0'); } $found6 || return &text('feat_evalidateip6', $d->{'ip6'}, $d->{'web_port'}); From 7f099a6c1bb450494bc0ad1c9a01467e6ead812d Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Sat, 13 Mar 2021 16:46:07 +0300 Subject: [PATCH 3/4] Version bump 2.19 --- module.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.info b/module.info index afea7f9..23893f6 100644 --- a/module.info +++ b/module.info @@ -1,4 +1,4 @@ desc=Nginx Webserver category=servers -version=2.18 +version=2.19 readonly=1 From 12a821df95e2a770eb5955ae687e2a7790d9271b Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Thu, 18 Mar 2021 11:59:27 +0300 Subject: [PATCH 4/4] Index for `index.php` must come first --- virtual_feature.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtual_feature.pl b/virtual_feature.pl index b749bfc..1ad825d 100644 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -185,7 +185,7 @@ sub feature_setup # Allow sensible index files push(@{$server->{'members'}}, { 'name' => 'index', - 'words' => [ 'index.html', 'index.htm', 'index.php' ] }); + 'words' => [ 'index.php', 'index.html', 'index.htm' ] }); # Add a location for the root #push(@{$server->{'members'}},