Skip to content

Commit

Permalink
Merge branch 'master' of github.com:virtualmin/virtualmin-nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Mar 20, 2021
2 parents b14e728 + 12a821d commit 915f5b5
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ stop_cmd=killall nginx
apply_cmd=killall nginx ; sleep 1 ; /usr/local/nginx/sbin/nginx >/dev/null 2>&1 </dev/null &
child_procs=4
php_socket=1
listen_mode=0
listen_mode=1
http2=0
2 changes: 1 addition & 1 deletion config-CentOS-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ stop_cmd=systemctl stop nginx
apply_cmd=systemctl restart nginx
child_procs=4
php_socket=1
listen_mode=0
listen_mode=1
http2=0
2 changes: 1 addition & 1 deletion config-Redhat-Enterprise-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ stop_cmd=service nginx stop
apply_cmd=service nginx restart
child_procs=4
php_socket=1
listen_mode=0
listen_mode=1
http2=0
2 changes: 1 addition & 1 deletion config-Scientific-Linux-7.0-ALL
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ stop_cmd=service nginx stop
apply_cmd=service nginx restart
child_procs=4
php_socket=1
listen_mode=0
listen_mode=1
http2=0
2 changes: 1 addition & 1 deletion config-debian-linux
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ add_to=/etc/nginx/sites-available
add_link=/etc/nginx/sites-enabled
child_procs=4
php_socket=1
listen_mode=0
listen_mode=1
http2=0
2 changes: 1 addition & 1 deletion config-redhat-linux
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ stop_cmd=/etc/init.d/nginx stop
apply_cmd=/etc/init.d/nginx restart
child_procs=4
php_socket=1
listen_mode=0
listen_mode=1
http2=0
2 changes: 1 addition & 1 deletion module.info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
desc=Nginx Webserver
category=servers
version=2.18
version=2.19
readonly=1
16 changes: 7 additions & 9 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -156,26 +156,24 @@ 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'}) {
if ($config{'listen_mode'} eq '0') {
# Just use port numbers
push(@{$server->{'members'}},
{ 'name' => 'listen',
'words' => [ $d->{'web_port'}, @h2 ] });
'words' => [ $d->{'web_port'} ] });
}
else {
# Use IP and port
my $portstr = $d->{'web_port'} == 80 ? ''
: ':'.$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' ) : ( ) ] });
}
}

Expand All @@ -187,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'}},
Expand Down Expand Up @@ -894,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'});
Expand All @@ -906,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'});
Expand Down

0 comments on commit 915f5b5

Please sign in to comment.