Menu

How to force HTTPS behind ELB

2018-03-29 - Apache2.4, AWS
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker
RewriteCond %{REMOTE_ADDR} !^10\.
RewriteCond %{REMOTE_ADDR} !^127\.
RewriteCond %{REMOTE_ADDR} !^192\.
RewriteCond %{REMOTE_ADDR} !^localhost$ [NC]
RewriteCond %{REMOTE_ADDR} !^::1$ [NC]
RewriteRule ^.* https://%{HTTP_HOST}%{REQUEST_URI}/ [R=301,L]

You have to describe this in

or

or
.htaccess