From 125b463bf34fcc47c24e155f1541c003735902c3 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 11 Dec 2016 20:51:31 +0100 Subject: [PATCH] Fix X-Forwarded-Proto --- .../templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content index 0c8bb74..b921cee 100644 --- a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content @@ -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\.\-/]*|){