mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-15 18:18:04 +00:00
Merge pull request #5971 from Juice-de-Orange/fix/hsts-subdomains-per-host
fix: apply the HSTS sub-domains setting per host
This commit is contained in:
2 files changed
+10
-3
No files matched your search
@@ -2,7 +2,11 @@
|
||||
{% if ssl_forced == 1 or ssl_forced == true %}
|
||||
{% if hsts_enabled == 1 or hsts_enabled == true %}
|
||||
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
|
||||
add_header Strict-Transport-Security $hsts_header always;
|
||||
{% if hsts_subdomains == 1 or hsts_subdomains == true %}
|
||||
add_header Strict-Transport-Security $hsts_header_subdomains always;
|
||||
{% else %}
|
||||
add_header Strict-Transport-Security $hsts_header_plain always;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -1,3 +1,6 @@
|
||||
map $scheme $hsts_header {
|
||||
https "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload";
|
||||
map $scheme $hsts_header_plain {
|
||||
https "max-age=63072000; preload";
|
||||
}
|
||||
map $scheme $hsts_header_subdomains {
|
||||
https "max-age=63072000;includeSubDomains; preload";
|
||||
}
|
||||
Reference in new issue
Block a user