From 541fdc1982679371d5675dc8aeb183b70bda84cb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 4 Jun 2020 15:04:32 +0200 Subject: [PATCH] switch from add_header to more_set_headers ! Do not use 'add_header' in the nginx conf. Use 'more_set_headers' instead. (See https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx and https://github.com/openresty/headers-more-nginx-module#more_set_headers ) --- conf/nginx.conf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3c252af..695a908 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,25 +16,25 @@ client_max_body_size 16m; - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Allow-Methods' 'POST, PUT, DELETE, GET, PATCH, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Idempotency-Key' always; - add_header 'Access-Control-Expose-Headers' 'Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id' always; + more_set_headers "Access-Control-Allow-Origin : *"; + more_set_headers "Access-Control-Allow-Methods : POST, PUT, DELETE, GET, PATCH, OPTIONS"; + more_set_headers "Access-Control-Allow-Headers : Authorization, Content-Type, Idempotency-Key"; + more_set_headers "Access-Control-Expose-Headers : Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id"; if ($request_method = OPTIONS) { return 204; } # stop removing lines here. - add_header X-XSS-Protection "1; mode=block" always; - add_header X-Permitted-Cross-Domain-Policies "none" always; - add_header X-Frame-Options "DENY" always; - add_header X-Content-Type-Options "nosniff" always; - add_header Referrer-Policy "same-origin" always; - add_header X-Download-Options "noopen" always; - #add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action *; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://__DOMAIN__; upgrade-insecure-requests;" always; + more_set_headers "X-XSS-Protection : 1; mode=block"; + more_set_headers "X-Permitted-Cross-Domain-Policies : none"; + more_set_headers "X-Frame-Options : DENY"; + more_set_headers "X-Content-Type-Options : nosniff"; + more_set_headers "Referrer-Policy : same-origin"; + more_set_headers "X-Download-Options : noopen"; + # more_set_headers "Content-Security-Policy : default-src 'none'; base-uri 'self'; form-action *; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://__DOMAIN__; upgrade-insecure-requests;"; # Uncomment this only after you get HTTPS working. - # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + # more_set_headers "Strict-Transport-Security : max-age=31536000; includeSubDomains"; # Include SSOWAT user panel.