-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Security headers only printed when ssl is enabled #162
Comments
I'm not sure if sending additional headers over HTTP apart from usual redirect to HTTPS is proper or not. It seems to me that you want to push as much over HTTPS as possible. @ypid, since you know more about HSTS than me, what's your thoughts about this? |
I looked over the RFC again but did not find something immediately. So I checked someone who knows more then me as well 😉 curl http://ssllabs.com https://ssllabs.com -I HTTP/1.1 302 Found I agree with @drybjed and ssllabs. No need to send those headers over plain legacy HTTP. User agents will remember HSTS for the time specified. |
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security#Description |
Thanks for the digging @ypid and @drybjed - it seems like based on first example of curling http where X-Content-Type-Options, X-Xss-Protection, and Content-Security-Policy this change is desired - currently none of these headers would be returned if ssl is not turned on. For the hsts header, the use case I see is when nginx is reverse proxying behind a load balancer which handles the ssl decryption/etc., in this case although the site is serving tls traffic, it's transparent to that instance of nginx. |
This is true on the latest released version and I don't believe it's been fixed on master - a misplaced
{% endif %}
fixed this on the released version, however, I wanted to confirm that the behavior I was expecting was the intended behavior.This patch would move the
endif
to applying to theif nginx_tpl_ssl
up so that all the headers fromhsts_enabled
topermitted_cross_domain_policies
are no longer dependent on nginx using ssl. What do you think?The text was updated successfully, but these errors were encountered: