Set X-Forwarded-Proto for proxypass vhosts

This commit is contained in:
Daniel Berteaud 2016-12-11 20:25:37 +01:00
parent 584b14b5bf
commit eea343f2da
1 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ my @alias = split /[,;]/, ($domain->prop('Alias') || '');
my @env = split(/[;,]/, ($domain->prop('SetEnv') || ''));
my $auth = $domain->prop('Authentication') || 'none';
my @groups = split(/[;,]/, ($domain->prop('AllowGroups') || ''));
my $ssl_port = $modSSL{'TCPPort'} || '443';
# ProxyPass ?
if ($target =~ m|https?://[\d\w\.\-/]*|){
@ -33,6 +34,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";
}
# Rewrite ?
elsif ($rewrite =~ m|https?://[\d\w\.\-/]*|){