-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
HSTS does not work #417
Comments
you mean |
No, I mean that I want the setting The point is that the current setup simply is broken. So "We are correctly configuring HSTS in the nginx configs as user specifies them in the configs." still is not true, because
Accessed the running instance using curl (real host hidden here):
b) you miss to set the headers for all HTTPS responses (e.g. 302, 404) I had similar issues in a different nginx setup -- for me the solution was to replace the |
@istr sorry for the delay. I have been spending time investigating the issue where the HSTS headers are missing from the response. It appears that the reason why the header is missing is that some of the location blocks also have For example, in the following block, the server {
...
add_header Strict-Transport-Security "max-age=31536000';";
...
location / {
...
add_header X-Accel-Buffering off;
...
}
} This is the exact issue that is occuring. To avoid spewing the server {
...
add_header Strict-Transport-Security "max-age=31536000';";
add_header X-Accel-Buffering off;
...
location / {
...
}
} What do you think? |
Great! That should solve the issue. Thanks. |
If you set up a vanilla docker-gitlab with a real certificate and test using SSL Labs you will find that HSTS does not work.
There are multiple issues; those already outlined in #138 and #206.
Apart from that:
Strict-Transport-Security
header, ever (this is due to a defect in the simpleadd_header
mechanism that could be replaced with themore_set_headers
module)I went through the intricacy of setting up HSTS with nginx reliably in a different context (including upstream services and nginx as SSL offloader), so maybe will try to fork and propose a PR.
The text was updated successfully, but these errors were encountered: