nginx being serious
This commit is contained in:
parent
279424d86d
commit
31cadb9402
1 changed files with 7 additions and 3 deletions
|
@ -27,6 +27,12 @@ http {
|
||||||
|
|
||||||
#gzip on;
|
#gzip on;
|
||||||
|
|
||||||
|
# Set HSTS if forwarded proto is https
|
||||||
|
map $http_x_forwarded_proto $hsts_header {
|
||||||
|
default "";
|
||||||
|
https "max-age=31536000; includeSubDomains;";
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
|
|
||||||
|
@ -60,9 +66,7 @@ http {
|
||||||
|
|
||||||
sendfile off;
|
sendfile off;
|
||||||
|
|
||||||
if ($http_x_forwarded_proto = "https") {
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";
|
|
||||||
}
|
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Robots-Tag none;
|
||||||
|
|
Reference in a new issue