melbo
Well-known member
So I'm currently forcing all of my http traffic to SSL/TLS via an Apache RewriteCond/RewriteRule in httpd.conf:
I'm reading up on HSTS and it looks like I can do this better with the following:
http://linux-audit.com/configure-hsts-http-strict-transport-security-apache-nginx/
I'm assuming this would be in httpd.conf (replacing my above rewrites?)
With this in ssl.conf:
I currently fail the HSTS Chrome preload submission test and its likely due to this 301. Anyone successfully set this up? Can I set this up in ssl.conf and remove all rules from https.conf? Confused as to where I add this.
https://hstspreload.appspot.com/
Code:
# Force non-ssl and non www to https
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTP_HOST} !^www.DOMAIN\.com$
RewriteRule ^(.*)$ https://www.DOMAIN.com/$1 [R=301,L]
I'm reading up on HSTS and it looks like I can do this better with the following:
http://linux-audit.com/configure-hsts-http-strict-transport-security-apache-nginx/
I'm assuming this would be in httpd.conf (replacing my above rewrites?)
Code:
# Redirect HTTP connections to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
With this in ssl.conf:
Code:
Strict-Transport-Security: max-age=10886400; includeSubDomains; preload
I currently fail the HSTS Chrome preload submission test and its likely due to this 301. Anyone successfully set this up? Can I set this up in ssl.conf and remove all rules from https.conf? Confused as to where I add this.
https://hstspreload.appspot.com/
Last edited: