My website makes use of Universal SSL from CloudFlare and I would like to have the browser redirect to HTTPS automatically. However, as not all browsers support the type of SSL cloudflare uses, I don't want to outright force SSL. So HSTS seems to be a good option. However, when I test it in my browser it doesn't appear to be working as I expect it to.
In my configuration file for the site, I have this line:
server {
...
listen 443 ssl;
add_header Strict-Transport-Security max-age=63072000;
...
}
And it shows up in the response headers:
Strict-Transport-Security: max-age=63072000
However Firefox 35 and Chrome 41 on Windows 10 and OS X 10.10.3 will still navigate the site on HTTP without redirecting to HTTPS.
I am using NGINX Version 1.7.3 running on CentOS 7.