Skip to content

Commit

Permalink
Fix listen mode logic
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Mar 13, 2021
1 parent 85aad09 commit 689c5e5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 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
6 changes: 3 additions & 3 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ sub feature_setup
'words' => [ &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',
Expand Down Expand Up @@ -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'});
Expand All @@ -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'});
Expand Down

0 comments on commit 689c5e5

Please sign in to comment.