Browse Source

Remove http directives.

These are included within a http block, and it's illegal to nest them.
pull/9/head
Chris Smith 8 years ago
parent
commit
ba587b3cbd
3 changed files with 24 additions and 33 deletions
  1. 4
    7
      extra/hsts.conf
  2. 11
    14
      extra/security.conf
  3. 9
    12
      extra/ssl.conf

+ 4
- 7
extra/hsts.conf View File

@@ -2,12 +2,9 @@
2 2
 # always request the resource over HTTPS, preventing a stripping/downgrade
3 3
 # attack.
4 4
 
5
-http {
6
-
7
-    map $scheme $hsts_header {
8
-        https   max-age=31536000;
9
-    }
5
+map $scheme $hsts_header {
6
+    https   max-age=31536000;
7
+}
10 8
 
11
-    add_header Strict-Transport-Security $hsts_header;
9
+add_header Strict-Transport-Security $hsts_header;
12 10
 
13
-}

+ 11
- 14
extra/security.conf View File

@@ -1,20 +1,17 @@
1 1
 # General security-related directives.
2 2
 
3
-http {
3
+# Don't offer up information about the version of Nginx we use
4
+server_tokens      off;
4 5
 
5
-    # Don't offer up information about the version of Nginx we use
6
-    server_tokens      off;
6
+# Don't allow other websites to present our content in a frame/iframe.
7
+# This mitigates clickjacking attacks.
8
+add_header         X-Frame-Options "SAMEORIGIN";
7 9
 
8
-    # Don't allow other websites to present our content in a frame/iframe.
9
-    # This mitigates clickjacking attacks.
10
-    add_header         X-Frame-Options "SAMEORIGIN";
10
+# Don't allow browsers to try and sniff content types. This prevents
11
+# malicious user-generated content being misinterpreted.
12
+add_header         X-Content-Type-Options "nosniff";
11 13
 
12
-    # Don't allow browsers to try and sniff content types. This prevents
13
-    # malicious user-generated content being misinterpreted.
14
-    add_header         X-Content-Type-Options "nosniff";
14
+# Enable XSS protection, if browsers don't already have it enabled
15
+# by default.
16
+add_header         X-XSS-Protection "1; mode=block";
15 17
 
16
-    # Enable XSS protection, if browsers don't already have it enabled
17
-    # by default.
18
-    add_header         X-XSS-Protection "1; mode=block";
19
-
20
-}

+ 9
- 12
extra/ssl.conf View File

@@ -15,16 +15,13 @@
15 15
 #
16 16
 # Older browsers or platforms won't be able to negotiate a connection.
17 17
 
18
-http {
18
+ssl_protocols               TLSv1.2;
19
+ssl_ciphers                 "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256";
20
+ssl_prefer_server_ciphers   on;
21
+ssl_session_timeout         1d;
22
+ssl_session_cache           shared:SSL:50m;
23
+ssl_session_tickets         off;
24
+ssl_stapling                on;
25
+ssl_stapling_verify         on;
26
+resolver                    8.8.8.8;
19 27
 
20
-    ssl_protocols               TLSv1.2;
21
-    ssl_ciphers                 "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256";
22
-    ssl_prefer_server_ciphers   on;
23
-    ssl_session_timeout         1d;
24
-    ssl_session_cache           shared:SSL:50m;
25
-    ssl_session_tickets         off;
26
-    ssl_stapling                on;
27
-    ssl_stapling_verify         on;
28
-    resolver                    8.8.8.8;
29
-
30
-}

Loading…
Cancel
Save