Recently, I had to force https traffic in one of
the project for the production server setup in AWS. My configuration looks as
below.
I have ELB configured to load balance end users
requests to the Apache on the backend. The ELB listeners are configured as
below
HTTP Port 80 -> 80
HTTPS Port 443 -> 443 with backend
authentication disabled.
Both the listeners are configured with ELB cookie
stickiness policy.
(this assumes your health status is on /status, which doesn't require https)<VirtualHost *:80>
...
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
...
</VirtualHost>
No comments:
Post a Comment