I would like to implement HSTS to my application.
I have an ELB terminating SSL and forwarding the traffic to my application, which is an apache server used as reverse p
If you're working with Apache 2.4+, you may be familiar with expressions and the directives
,
, and
.
I have a complex configuration between dev, staging, and production environments, so relying on the [L]
flag with the RewriteRule
just wouldn't cut it for me.
This brought me to the following solution, which I placed in my .htaccess:
Header set Strict-Transport-Security "max-age=31536000"
It works better in my environment and I feel that it is more reliable for meeting the RFC.
You could drop the "%{REQUEST_SCHEME} == 'https'
part if you never hit your instances directly, but that's part of my debug process in my dev environments.
Much thanks to Pedreiro for pointing me in the right direction for the actual specifications on the HSTS RFC.