File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,16 @@ CustomLog /dev/stdout proxy env=forwarded
3939 Require all granted
4040 </Directory>
4141
42- {{- if $vhost.TLS }}
42+ {{- if $vhost.TLS }}
4343 SetEnvIf X-Forwarded-Proto https HTTPS=1
4444
4545 ## SSL directives
4646 SSLEngine on
4747 SSLCertificateFile "{{ $vhost.SSLCertificateFile }}"
4848 SSLCertificateKeyFile "{{ $vhost.SSLCertificateKeyFile }}"
49- {{- end }}
49+ {{- else }}
50+ SetEnvIf X-Forwarded-Proto http HTTPS=0
51+ {{- end }}
5052
5153 ## WSGI configuration
5254 WSGIApplicationGroup %{GLOBAL}
Original file line number Diff line number Diff line change @@ -30,22 +30,28 @@ CustomLog /dev/stdout proxy env=forwarded
3030 ServerName {{ $vhost.ServerName }}
3131
3232 ## Request header rules
33- ## as per http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader
34- RequestHeader set X-Forwarded-Proto "https"
33+ ## as per http://httpd.apache.org/docs/2.4/mod/mod_headers.html#requestheader
34+ {{- if $vhost.TLS }}
35+ RequestHeader setIfEmpty X-Forwarded-Proto "https"
36+ {{- else }}
37+ RequestHeader setIfEmpty X-Forwarded-Proto "http"
38+ {{- end }}
3539
3640 ## Proxy rules
3741 ProxyRequests Off
3842 ProxyPreserveHost Off
3943 ProxyPass / http://localhost:5051 / retry=10
4044 ProxyPassReverse / http://localhost:5051 /
4145
42- {{- if $vhost.TLS }}
46+ {{- if $vhost.TLS }}
4347 SetEnvIf X-Forwarded-Proto https HTTPS=1
4448
4549 ## SSL directives
4650 SSLEngine on
4751 SSLCertificateFile "{{ $vhost.SSLCertificateFile }}"
4852 SSLCertificateKeyFile "{{ $vhost.SSLCertificateKeyFile }}"
49- {{- end }}
53+ {{- else }}
54+ SetEnvIf X-Forwarded-Proto http HTTPS=0
55+ {{- end }}
5056</VirtualHost >
5157{{ end }}
You can’t perform that action at this time.
0 commit comments