Fix X-Forwarded-Proto

This commit is contained in:
Daniel Berteaud 2016-12-11 20:51:31 +01:00
parent eea343f2da
commit 125b463bf3
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@ my @env = split(/[;,]/, ($domain->prop('SetEnv') || ''));
my $auth = $domain->prop('Authentication') || 'none';
my @groups = split(/[;,]/, ($domain->prop('AllowGroups') || ''));
my $ssl_port = $modSSL{'TCPPort'} || '443';
my $proto = ($port eq $ssl_port ) ? 'https' : 'http';
# ProxyPass ?
if ($target =~ m|https?://[\d\w\.\-/]*|){
@ -34,7 +35,7 @@ if ($target =~ m|https?://[\d\w\.\-/]*|){
$OUT .= " ProxyPassReverse / $target\n";
}
$OUT .= " ProxyPreserveHost on\n" if ($preserve eq 'yes');
$OUT .= " RequestHeader set X-Forwarded-Proto \"" . ($port eq $ssl_port) ? 'https' : 'http' . "\"\n";
$OUT .= " RequestHeader set X-Forwarded-Proto \"$proto\"\n";
}
# Rewrite ?
elsif ($rewrite =~ m|https?://[\d\w\.\-/]*|){