Force HTTPS with AWS Elastic load balancer
- by panos2point0
I need to redirect all incoming HTTP traffic to HTTPS on my elastic load balancer.
I tired using Apache mod_rewrite:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Taking advantage of the X-Forwarded-Proto header added by the load balancer, this rule should…