mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #68] Duplicate HSTS headers #65
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pageb018 on GitHub (Feb 12, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/68
Not sure if I am missing something. I added
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;to the custom NGINX section of a proxy host config. I can see the line added to the .conf files, but when running an SSL labs test it doesn't seem to apply.
Any ideas?
@jc21 commented on GitHub (Feb 18, 2019):
HSTS is already declared in all SSL Proxy Hosts with the following:
however this doesn't include subdomains and isn't always set, so there might be room for this configuration to move to the frontend and be controlled by the UI.
Furthermore, there is the following "quirk" with nginx:
This means that, no matter which
add_headerlines put in the advanced config, it will be discarded in the location blocks and they will need to be redeclared again; which you can't do in the UI currently.Thanks for finding this process error. It will need to be fixed properly.
@pageb018 commented on GitHub (Feb 19, 2019):
Just an FYI. Not sure if it matters but SSL Labs are still throwing an error:
"Server sent invalid HSTS policy. See below for further information."
"Strict Transport Security (HSTS) | Invalid Server provided more than one HSTS header"
@jc21 commented on GitHub (Feb 20, 2019):
So, after pulling the
latestdocker tag and editing your Proxy Host and saving it with HSTS enabled, you should be able to inspect the headers of the requests yourself and make sure there only 1 header.After the latest release, all SSL enabled Hosts need to be edited and saved so that the new configuration would be generated for them.
@pageb018 commented on GitHub (Feb 20, 2019):
So it does look like this is being applied twice. When I enable in the GUI, i see the following in the .conf
@jc21 commented on GitHub (Feb 21, 2019):
Oh ok yeah so I did that on purpose... Because nginx doc (mentioned above) says that it will discard any
add_headeritems from theserverblock when there is at least 1 used in alocationblock, I added it to both and the first one is meant to be discarded, but I guess it isn't. I'll have to test it further.@pageb018 commented on GitHub (Feb 21, 2019):
Cool. Thanks for checking.
By the way, thank you for this awesome piece of software. It's fantastic and so much better than writing .conf files!
I also wanted to confirm that certs auto-renew...I don't see that in the docs.
thanks again.
@rudders commented on GitHub (Feb 23, 2019):
+1 for the auto-renew of certs questions - I can't seem to find that in the doco..
@jc21 commented on GitHub (Feb 25, 2019):
Auto renewal is definitely happening. When the docker image is started you'll see a log entry:
@chaptergy commented on GitHub (Oct 25, 2021):
SSLlabs no longer trows this error, presumably because of a newer version of nginx which handles this more gracefully.
@nickelswitte commented on GitHub (May 7, 2023):
I dont know why, but I still have the duplication issue. I just wanted to add some headers via the advanced config, and they all appear twice in the sent response by the server. It does not seem that nginx will discard the previous one.
The config in npm
The response: