@@ -16,7 +16,7 @@ stream {
16
16
upstream dns {
17
17
zone dns 64k ;
18
18
server overture:5353;
19
- # server overture2:5353;
19
+ server overture2:5353;
20
20
}
21
21
22
22
# DNS(TCP) and DNS over TLS (DoT) Server
@@ -39,18 +39,33 @@ http {
39
39
}
40
40
access_log off ;
41
41
# Proxy Cache storage - so we can cache the DoH response from the upstream
42
- proxy_cache_path /var/run/doh_cache levels=1:2 keys_zone=doh_cache:10m;
43
42
server {
44
43
# Listen on standard HTTPS port, and accept HTTP2, with SSL termination
45
44
listen 443 ssl http2;
46
45
server_name dns.coolrc.top;
46
+ server_tokens off ;
47
+
48
+ ssl_protocols TLSv1.2 TLSv1.3; # TLS 1.3 requires nginx >= 1.13.0
49
+ ssl_prefer_server_ciphers on ;
50
+ ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
51
+
52
+ ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
53
+ ssl_session_timeout 10m ;
54
+ ssl_session_cache shared:SSL:10m;
55
+ ssl_session_tickets off; # Requires nginx >= 1.5.9
56
+ ssl_stapling on; # Requires nginx >= 1.3.7
57
+ ssl_stapling_verify on; # Requires nginx => 1.3.7
58
+ ssl_early_data off; # 0-RTT, enable if desired - Requires nginx >= 1.15.4
59
+ resolver overture:5353 valid=300s;
60
+
47
61
ssl_certificate /ssl/fullchain.pem;
48
62
ssl_certificate_key /ssl/privkey.pem;
49
- ssl_session_cache shared:ssl_cache:10m;
50
- ssl_session_timeout 10m ;
51
63
52
- # DoH may use GET or POST requests, Cache both
53
- proxy_cache_methods GET POST;
64
+ # HTTP Security Headers
65
+ add_header X-Frame-Options DENY;
66
+ add_header X-Content-Type-Options nosniff;
67
+ add_header X-XSS-Protection "1; mode=block" ;
68
+ add_header Strict-Transport-Security "max-age=63072000" ;
54
69
55
70
# Return 404 to all responses, except for those using our published DoH URI
56
71
location / {
65
80
proxy_http_version 1.1 ;
66
81
proxy_set_header Connection "" ;
67
82
68
- # Enable Cache, and set the cache_key to include the request_body
69
- proxy_cache doh_cache;
70
- proxy_cache_key $scheme$proxy_host$uri$is_args$args$request_body ;
71
83
proxy_pass http://dohsrv/dns-query;
72
84
proxy_set_header Host $host ;
73
85
proxy_set_header X-Real-IP $remote_addr ;
0 commit comments