-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
585 lines (544 loc) · 17.7 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
user www-data;
pid /run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65535;
include /etc/nginx/modules-enabled/*.conf;
events {
multi_accept on;
worker_connections 65535;
}
http {
gzip on;
# brotli on;
# brotli_static on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
autoindex on;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 32M;
client_header_buffer_size 8m;
large_client_header_buffers 8 8m;
fastcgi_buffer_size 8m;
fastcgi_buffers 8 8m;
fastcgi_read_timeout 600;
proxy_cache_path /opt/nginx/proxy_temp_pximg/ levels=1:2 keys_zone=pximg:10m max_size=1g inactive=7d use_temp_path=off;
upstream www-pixiv-net {
server 210.140.131.223:443;
server 210.140.131.225:443;
server 210.140.131.220:443;
}
upstream account-pixiv-net {
server 210.140.131.226:443;
server 210.140.131.218:443;
server 210.140.131.222:443;
}
upstream sketch-pixiv-net {
server 210.140.174.37:443;
server 210.140.170.179:443;
server 210.140.175.130:443;
}
upstream sketch-hls-server {
server 210.140.214.211:443;
server 210.140.214.212:443;
server 210.140.214.213:443;
}
upstream imgaz-pixiv-net {
server 210.140.131.145:443;
server 210.140.131.144:443;
server 210.140.131.147:443;
server 210.140.131.153:443;
}
upstream i-pximg-net {
server 210.140.92.140:443;
server 210.140.92.137:443;
server 210.140.92.139:443;
server 210.140.92.142:443;
server 210.140.92.134:443;
server 210.140.92.141:443;
server 210.140.92.143:443;
server 210.140.92.136:443;
server 210.140.92.138:443;
server 210.140.92.144:443;
server 210.140.92.145:443;
}
upstream app-api-pixiv-net {
server 210.140.131.218:443;
server 210.140.131.223:443;
server 210.140.131.226:443;
}
upstream wikipedia-text-lb {
server 208.80.153.224:443;
server 91.198.174.192:443;
}
upstream wikipedia-upload-lb {
server 208.80.153.240:443;
server 208.80.154.240:443;
server 91.198.174.208:443;
server 103.102.166.240:443;
}
upstream exhentai-lb {
server 178.175.128.252:443;
server 178.175.128.254:443;
server 178.175.129.252:443;
server 178.175.129.254:443;
server 178.175.132.20:443;
server 178.175.132.22:443;
}
upstream e-hentai-lb {
server 104.20.26.25:443;
server 104.20.27.25:443;
}
server {
listen 8000;
listen [::]:8000;
listen 855 ssl http2 reuseport;
listen [::]:855 http2 reuseport;
ssl_certificate /etc/xray/xray.crt;
ssl_certificate_key /etc/xray/xray.key;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
root /var/www/html;
}
server {
listen 8880 proxy_protocol default_server;
listen 8443 http2 proxy_protocol default_server;
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
root /var/www/html;
server_name _;
grpc_read_timeout 1h;
grpc_send_timeout 1h;
grpc_set_header X-Real-IP $remote_addr;
location /grpc-vless {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:11000;
}
location /grpc-vmess {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:12000;
}
location /grpc-trojan {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:13000;
}
location ^~ /vless-grpc {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:24456;
}
location ^~ /vmess-grpc {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:31234;
}
location ^~ /trojan-grpc {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:33456;
}
location ^~ /socks5-grpc {
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:16000;
}
location ~ /vmess {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /vmess break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:23456;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location ~ /worryfree {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /worryfree break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:71;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location ~ /kuota-habis {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /kuota-habis break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:72;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location ~ /noobzvpn {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /noobzvpn break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location ~ /trojango {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /trojango break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:2087;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location ~ /v {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /v break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:14016;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
location ~ /t {
if ($http_upgrade != "Websocket") {
rewrite /(.*) /t break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:25432;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
location ~ /ssh {
if ($http_upgrade != "Upgrade") {
rewrite /(.*) /ssh break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:95;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 1d;
}
}
server {
listen 2082;
listen [::]:2082;
listen 2053 ssl http2 reuseport;
listen [::]:2053 http2 reuseport;
server_name www.rerechanstore.eu.org;
ssl_certificate /etc/xray/xray.crt;
ssl_certificate_key /etc/xray/xray.key;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
root /home/vps/public_html;
location / {
if ($http_upgrade != "Upgrade") {
rewrite /(.*) / break;
}
proxy_redirect off;
proxy_set_header Server Thengine;
proxy_pass http://127.0.0.1:95;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}
server {
listen 2095;
listen [::]:2095;
listen 2056 ssl http2 reuseport;
listen [::]:2056 http2 reuseport;
server_name www.rerechanstore.eu.org;
ssl_certificate /etc/xray/xray.crt;
ssl_certificate_key /etc/xray/xray.key;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
root /home/vps/public_html;
location / {
if ($http_upgrade != "Upgrade") {
rewrite /(.*) / break;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:9123;
proxy_set_header Server Thengine;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}
charset utf-8;
log_not_found off;
types_hash_bucket_size 64;
access_log off;
error_log /dev/null;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_protocols TLSv1.3;
ssl_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
resolver_timeout 2s;
#Cloudflare
# - 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;
#cloudfront
set_real_ip_from 120.52.22.96/27;
set_real_ip_from 205.251.249.0/24;
set_real_ip_from 180.163.57.128/26;
set_real_ip_from 204.246.168.0/22;
set_real_ip_from 111.13.171.128/26;
set_real_ip_from 18.160.0.0/15;
set_real_ip_from 205.251.252.0/23;
set_real_ip_from 54.192.0.0/16;
set_real_ip_from 204.246.173.0/24;
set_real_ip_from 54.230.200.0/21;
set_real_ip_from 120.253.240.192/26;
set_real_ip_from 116.129.226.128/26;
set_real_ip_from 130.176.0.0/17;
set_real_ip_from 108.156.0.0/14;
set_real_ip_from 99.86.0.0/16;
set_real_ip_from 205.251.200.0/21;
set_real_ip_from 13.32.0.0/15;
set_real_ip_from 120.253.245.128/26;
set_real_ip_from 13.224.0.0/14;
set_real_ip_from 70.132.0.0/18;
set_real_ip_from 15.158.0.0/16;
set_real_ip_from 111.13.171.192/26;
set_real_ip_from 13.249.0.0/16;
set_real_ip_from 18.238.0.0/15;
set_real_ip_from 18.244.0.0/15;
set_real_ip_from 205.251.208.0/20;
set_real_ip_from 65.9.128.0/18;
set_real_ip_from 130.176.128.0/18;
set_real_ip_from 58.254.138.0/25;
set_real_ip_from 54.230.208.0/20;
set_real_ip_from 3.160.0.0/14;
set_real_ip_from 116.129.226.0/25;
set_real_ip_from 52.222.128.0/17;
set_real_ip_from 18.164.0.0/15;
set_real_ip_from 111.13.185.32/27;
set_real_ip_from 64.252.128.0/18;
set_real_ip_from 205.251.254.0/24;
set_real_ip_from 54.230.224.0/19;
set_real_ip_from 71.152.0.0/17;
set_real_ip_from 216.137.32.0/19;
set_real_ip_from 204.246.172.0/24;
set_real_ip_from 18.172.0.0/15;
set_real_ip_from 120.52.39.128/27;
set_real_ip_from 118.193.97.64/26;
set_real_ip_from 18.154.0.0/15;
set_real_ip_from 54.240.128.0/18;
set_real_ip_from 205.251.250.0/23;
set_real_ip_from 180.163.57.0/25;
set_real_ip_from 52.46.0.0/18;
set_real_ip_from 52.82.128.0/19;
set_real_ip_from 54.230.0.0/17;
set_real_ip_from 54.230.128.0/18;
set_real_ip_from 54.239.128.0/18;
set_real_ip_from 130.176.224.0/20;
set_real_ip_from 36.103.232.128/26;
set_real_ip_from 52.84.0.0/15;
set_real_ip_from 143.204.0.0/16;
set_real_ip_from 144.220.0.0/16;
set_real_ip_from 120.52.153.192/26;
set_real_ip_from 119.147.182.0/25;
set_real_ip_from 120.232.236.0/25;
set_real_ip_from 111.13.185.64/27;
set_real_ip_from 3.164.0.0/18;
set_real_ip_from 54.182.0.0/16;
set_real_ip_from 58.254.138.128/26;
set_real_ip_from 120.253.245.192/27;
set_real_ip_from 54.239.192.0/19;
set_real_ip_from 18.68.0.0/16;
set_real_ip_from 18.64.0.0/14;
set_real_ip_from 120.52.12.64/26;
set_real_ip_from 99.84.0.0/16;
set_real_ip_from 130.176.192.0/19;
set_real_ip_from 52.124.128.0/17;
set_real_ip_from 204.246.164.0/22;
set_real_ip_from 13.35.0.0/16;
set_real_ip_from 204.246.174.0/23;
set_real_ip_from 3.172.0.0/18;
set_real_ip_from 36.103.232.0/25;
set_real_ip_from 119.147.182.128/26;
set_real_ip_from 118.193.97.128/25;
set_real_ip_from 120.232.236.128/26;
set_real_ip_from 204.246.176.0/20;
set_real_ip_from 65.8.0.0/16;
set_real_ip_from 65.9.0.0/17;
set_real_ip_from 108.138.0.0/15;
set_real_ip_from 120.253.241.160/27;
set_real_ip_from 64.252.64.0/18;
set_real_ip_from 13.113.196.64/26;
set_real_ip_from 13.113.203.0/24;
set_real_ip_from 52.199.127.192/26;
set_real_ip_from 13.124.199.0/24;
set_real_ip_from 3.35.130.128/25;
set_real_ip_from 52.78.247.128/26;
set_real_ip_from 13.233.177.192/26;
set_real_ip_from 15.207.13.128/25;
set_real_ip_from 15.207.213.128/25;
set_real_ip_from 52.66.194.128/26;
set_real_ip_from 13.228.69.0/24;
set_real_ip_from 52.220.191.0/26;
set_real_ip_from 13.210.67.128/26;
set_real_ip_from 13.54.63.128/26;
set_real_ip_from 43.218.56.128/26;
set_real_ip_from 43.218.56.192/26;
set_real_ip_from 43.218.56.64/26;
set_real_ip_from 43.218.71.0/26;
set_real_ip_from 99.79.169.0/24;
set_real_ip_from 18.192.142.0/23;
set_real_ip_from 35.158.136.0/24;
set_real_ip_from 52.57.254.0/24;
set_real_ip_from 13.48.32.0/24;
set_real_ip_from 18.200.212.0/23;
set_real_ip_from 52.212.248.0/26;
set_real_ip_from 3.10.17.128/25;
set_real_ip_from 3.11.53.0/24;
set_real_ip_from 52.56.127.0/25;
set_real_ip_from 15.188.184.0/24;
set_real_ip_from 52.47.139.0/24;
set_real_ip_from 3.29.40.128/26;
set_real_ip_from 3.29.40.192/26;
set_real_ip_from 3.29.40.64/26;
set_real_ip_from 3.29.57.0/26;
set_real_ip_from 18.229.220.192/26;
set_real_ip_from 54.233.255.128/26;
set_real_ip_from 3.231.2.0/25;
set_real_ip_from 3.234.232.224/27;
set_real_ip_from 3.236.169.192/26;
set_real_ip_from 3.236.48.0/23;
set_real_ip_from 34.195.252.0/24;
set_real_ip_from 34.226.14.0/24;
set_real_ip_from 13.59.250.0/26;
set_real_ip_from 18.216.170.128/25;
set_real_ip_from 3.128.93.0/24;
set_real_ip_from 3.134.215.0/24;
set_real_ip_from 52.15.127.128/26;
set_real_ip_from 3.101.158.0/23;
set_real_ip_from 52.52.191.128/26;
set_real_ip_from 34.216.51.0/25;
set_real_ip_from 34.223.12.224/27;
set_real_ip_from 34.223.80.192/26;
set_real_ip_from 35.162.63.192/26;
set_real_ip_from 35.167.191.128/26;
set_real_ip_from 44.227.178.0/24;
set_real_ip_from 44.234.108.128/25;
set_real_ip_from 44.234.90.252/30;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
include /etc/nginx/conf.d/*.conf;
}