forked from Moder112/HWCInternalDatabase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
73 lines (61 loc) · 2.07 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# backup of the production nginx configuration
# ratelimit
limit_req_zone $binary_remote_addr zone=filesystem_limit:10m rate=5r/s;
server {
server_name hwcinternaldb.highquality.rip;
location @proxy {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_redirect off;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /filesystem {
limit_req zone=filesystem_limit burst=10 nodelay;
limit_req_status 429;
try_files $uri @proxy;
}
location / {
try_files $uri @proxy;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
# Redacted SSL configuration
ssl_certificate ; # managed by Certbot
ssl_certificate_key ; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
real_ip_header CF-Connecting-IP;
real_ip_recursive on;
# for testing site availability under heavy attack (to ratelimit a specific ip, thats not my own)
# set_real_ip_from MY_IP_ADDRESS_THAT_I_REMOVED;
# https://github.com/ergin/nginx-cloudflare-real-ip
# - IPv4
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
# - IPv6
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;
}