Skip to content

Commit fb10a67

Browse files
author
Emmanuel Eliason-Armstrong
committed
Nginx Web Server Hardening
1 parent 8521787 commit fb10a67

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nginx/conf.d/default.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
add_header X-XSS-Protection "1; mode=block";
2+
add_header X-Frame-Options "SAMEORIGIN";
3+
add_header X-Content-Type-Options nosniff;
4+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
5+
add_header 'Referrer-Policy' 'no-referrer-when-downgrade';
6+
17
server {
28
listen 80;
39
listen [::]:80;
@@ -23,4 +29,9 @@ server {
2329
proxy_set_header X-Forwarded-Proto https;
2430
proxy_pass http://ghost:2368;
2531
}
32+
if ($request_method !~ ^(GET|HEAD|POST)$ )
33+
{
34+
return 405;
35+
}
36+
2637
}

0 commit comments

Comments
 (0)