2
0
mirror of https://github.com/phanan/htaccess.git synced 2018-11-08 13:39:40 +01:00

Added redirect flag to force HTTPS when server is behind a reverse proxy

This commit is contained in:
Nam Dau 2015-09-30 11:40:33 +08:00
parent 0d0aaf0814
commit 973200d40c

View File

@ -104,8 +104,8 @@ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
### Force HTTPS Behind a Proxy ### Force HTTPS Behind a Proxy
Useful if you have a proxy in front of your server performing TLS termination. Useful if you have a proxy in front of your server performing TLS termination.
``` apacheconf ``` apacheconf
RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
``` ```
### Force Trailing Slash ### Force Trailing Slash