Skip to content

Commit f03dbc2

Browse files
authored
Merge pull request #103 from rwunderer/fix/remove-duplicate-drupal-headers
Avoid setting duplicate security headers when using Drupal
2 parents 5a567b3 + b864dcc commit f03dbc2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/includes/defaults.conf.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ add_header Cache-Control "no-store, no-cache, must-revalicate, post-check=0 pre-
66

77
{{- if not (getenv "NGINX_NO_DEFAULT_HEADERS") }}
88
add_header X-XSS-Protection '1; mode=block';
9+
{{/* the next two headers are being set by drupal already */}}
10+
{{- if ne (printf "%.6s" (getenv "NGINX_VHOST_PRESET")) "drupal" }}
911
add_header X-Frame-Options SAMEORIGIN;
1012
add_header X-Content-Type-Options nosniff;
13+
{{- end }}
1114
add_header Content-Security-Policy "{{ getenv "NGINX_HEADERS_CONTENT_SECURITY_POLICY" "frame-ancestors 'none'" }}";
1215
{{- end }}
1316

0 commit comments

Comments
 (0)