I'm trying to configure HSTS on my server. I've noticed that the test on SSLLabs.com will tell me that HSTS has been enabled if I send the HSTS header over the initial unencrypted HTTP connection. This, however, is in violation of the HSTS spec according to RFC-6797 Section 7.2, which clearly states that you should NOT send this header over an unencrypted connection.
On the other hand, if my server sends out that HSTS header ONLY after doing a 302 redirect from HTTP to HTTPS, which is precisely what the official HSTS spec says you SHOULD do, then SSL Labs does NOT acknowledge that I have HSTS enabled.
So what am I missing here? What's the actual correct way to do this?
If you want to see what I'm talking about, the site in question is nightowlcircusarts.com
You can view the unencrypted headers using curl with this bash command:
curl -I http://www.nightowlcircusarts.com/
Or change that http to https to see the encrypted headers:
curl -I https://www.nightowlcircusarts.com/
Currently, I have it configured to ONLY send that header over TLS, and not without it, as the HSTS spec says to do. But you'll see that the SSL Labs test still says I DON'T have HSTS enabled: https://www.ssllabs.com/ssltest/analyze.html?d=nightowlcircusarts.com