move headers to static location block, makes fastcgi_hide_header unnecessary
This commit is contained in:
parent
25abb55cd0
commit
4afa86cb3e
1 changed files with 15 additions and 21 deletions
|
@ -5,19 +5,22 @@ server {
|
|||
root /var/www;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
# no-transform tells Cloudflare and others to not change the content of
|
||||
# the file and thus breaking SRI.
|
||||
# https://developers.cloudflare.com/cache/about/cache-control#other
|
||||
add_header Cache-Control "public, max-age=3600, must-revalidate, no-transform";
|
||||
add_header Cross-Origin-Embedder-Policy require-corp;
|
||||
add_header Cross-Origin-Resource-Policy same-origin;
|
||||
add_header Cross-Origin-Opener-Policy same-origin;
|
||||
add_header Referrer-Policy no-referrer;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options deny;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
location / {
|
||||
# no-transform tells Cloudflare and others to not change the content of
|
||||
# the file and thus breaking SRI.
|
||||
# https://developers.cloudflare.com/cache/about/cache-control#other
|
||||
add_header Cache-Control "public, max-age=3600, must-revalidate, no-transform";
|
||||
add_header Cross-Origin-Embedder-Policy require-corp;
|
||||
add_header Cross-Origin-Opener-Policy same-origin;
|
||||
add_header Cross-Origin-Resource-Policy same-origin;
|
||||
# opt-out of Google FloC
|
||||
# https://developer.chrome.com/blog/floc/#how-can-websites-opt-out-of-the-floc-computation
|
||||
add_header Permissions-Policy interest-cohort=();
|
||||
add_header Referrer-Policy no-referrer;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options deny;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
include /etc/nginx/location.d/*.conf;
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
|
@ -29,15 +32,6 @@ server {
|
|||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
|
||||
fastcgi_hide_header Cache-Control;
|
||||
fastcgi_hide_header Cross-Origin-Embedder-Policy;
|
||||
fastcgi_hide_header Cross-Origin-Resource-Policy;
|
||||
fastcgi_hide_header Cross-Origin-Opener-Policy;
|
||||
fastcgi_hide_header Referrer-Policy;
|
||||
fastcgi_hide_header X-Content-Type-Options;
|
||||
fastcgi_hide_header X-Frame-Options;
|
||||
fastcgi_hide_header X-XSS-Protection;
|
||||
|
||||
# Prevent exposing nginx + version to $_SERVER
|
||||
fastcgi_param SERVER_SOFTWARE "";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue