It seems we shouldn't be adding this in a file in /etc/nginx/conf.d
By doing that we're adding it to both http and https and that's something we shouldn't do.
I'm doing this and I can assume many others as this was posted in one of the threads in this forum.
I can of course add the header to each https block of each site, but if there is something like a generic setting, this would be more than welcome.
I noticed this ticket: #289 (Add support for HTTP Strict Transport Security (HSTS / RFC 6797)) – nginx
Anyone knows how to put it in a file for all configurations, but stop it from being used in plain http?
Here is the quote from RFC6797 explicitly (MUST NOT) stating it should NOT be for http
RFC 6797 - HTTP Strict Transport Security (HSTS)
7.2
Code:
add_header Strict-Transport-Security "max-age=15768000; preload" always;
By doing that we're adding it to both http and https and that's something we shouldn't do.
I'm doing this and I can assume many others as this was posted in one of the threads in this forum.
I can of course add the header to each https block of each site, but if there is something like a generic setting, this would be more than welcome.
I noticed this ticket: #289 (Add support for HTTP Strict Transport Security (HSTS / RFC 6797)) – nginx
Anyone knows how to put it in a file for all configurations, but stop it from being used in plain http?
Here is the quote from RFC6797 explicitly (MUST NOT) stating it should NOT be for http
RFC 6797 - HTTP Strict Transport Security (HSTS)
7.2
An HSTS Host MUST NOT include the STS header field in HTTP responses
conveyed over non-secure transport.
Last edited: