[GH-ISSUE #2360] HSTS Header is added on HTTP hosts - Incorrect implementation of RFC6797 #1672

Closed
opened 2026-02-26 07:31:59 +03:00 by kerem · 5 comments
Owner

Originally created by @StanvanHoorn on GitHub (Nov 3, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2360

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes / No
  • Are you sure you're not using someone else's docker image?
    • Yes / No
  • Have you searched for similar issues (both open and closed)?
    • Yes / No

Describe the bug
HSTS is added in the server block of the Nginx for both port 80 and 443 resulting in warnings in various online tooling including hstspreload.org. This probably is caused by the fact that the generated Nginx config combines the port 80 and 443 servers. See:
#1 - Redirection host template;
#2 - Listen config;
#3 - HSTS config

Possible solution
Make different server config blocks for port 80 and 443, and only include the HSTS config in the one for 443 if enabled.

Nginx Proxy Manager Version
v2.9.18

Originally created by @StanvanHoorn on GitHub (Nov 3, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2360 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes / ~~No~~ - Are you sure you're not using someone else's docker image? - Yes / ~~No~~ - Have you searched for similar issues (both open and closed)? - Yes / ~~No~~ **Describe the bug** HSTS is added in the server block of the Nginx for both port 80 and 443 resulting in warnings in various online tooling including [hstspreload.org](hstspreload.org). This probably is caused by the fact that the generated Nginx config combines the port 80 and 443 servers. See: [#1 - Redirection host template](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/backend/templates/redirection_host.conf#L5); [#2 - Listen config](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/backend/templates/_listen.conf); [#3 - HSTS config](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/backend/templates/_hsts.conf) **Possible solution** Make different server config blocks for port 80 and 443, and only include the HSTS config in the one for 443 if enabled. **Nginx Proxy Manager Version** v2.9.18
kerem 2026-02-26 07:31:59 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@StanvanHoorn commented on GitHub (Dec 1, 2022):

Any plans to fix this?

<!-- gh-comment-id:1333888108 --> @StanvanHoorn commented on GitHub (Dec 1, 2022): Any plans to fix this?
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1928635557 --> @github-actions[bot] commented on GitHub (Feb 6, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@StanvanHoorn commented on GitHub (Feb 9, 2024):

As far as I know, this issue still persists

<!-- gh-comment-id:1935521361 --> @StanvanHoorn commented on GitHub (Feb 9, 2024): As far as I know, this issue still persists
Author
Owner

@github-actions[bot] commented on GitHub (Nov 20, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2487168727 --> @github-actions[bot] commented on GitHub (Nov 20, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Dec 3, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:3604737049 --> @github-actions[bot] commented on GitHub (Dec 3, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1672
No description provided.