Skip to content

Commit

Permalink
HTTP/2 cannot be used with non-SSL site
Browse files Browse the repository at this point in the history
.. and will actually cause PHP files to be downloads in http
  • Loading branch information
iliajie committed Mar 13, 2021
1 parent 5aa43b4 commit 85aad09
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 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'}) {
# 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 Down

0 comments on commit 85aad09

Please sign in to comment.