-
Notifications
You must be signed in to change notification settings - Fork 78
/
nginx.conf
47 lines (37 loc) · 1.18 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
upstream dohloop {
zone dohloop 64k;
server 127.0.0.1:8080;
}
server {
server_name _;
proxy_cache_methods GET POST;
location /dns-query {
proxy_pass http://dohloop;
proxy_http_version 1.0;
}
location / {
return 404 "404 Not Found\n";
}
listen 8443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/<YOUR_HOST>/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/<YOUR_HOST>/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
listen 80 default_server;
server_name _;
if ($host = "<YOUR_HOST>") {
return 301 https://$host$request_uri;
}
location / {
resolver 8.8.8.8;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_pass http://$host:80;
}
}