diff --git a/conf/E-hentai.conf b/conf/E-hentai.conf index b2e74ad..be30463 100644 --- a/conf/E-hentai.conf +++ b/conf/E-hentai.conf @@ -6,6 +6,9 @@ upstream exhentai-lb { server 178.175.129.254:443; server 178.175.132.20:443; server 178.175.132.22:443; + keepalive 16; + keepalive_timeout 120; + keepalive_requests 10000; } server { @@ -21,6 +24,8 @@ server { location / { proxy_pass https://exhentai-lb/; + keepalive_timeout 120; + proxy_set_header Connection ""; proxy_next_upstream_timeout 75; proxy_connect_timeout 10; proxy_send_timeout 5; @@ -34,8 +39,8 @@ upstream e-hentai-lb { server 212.7.202.48:443; server 212.7.200.92:443; server 212.7.200.95:443; - keepalive 4; - keepalive_timeout 120s; + keepalive 16; + keepalive_timeout 120; keepalive_requests 10000; } @@ -54,8 +59,10 @@ server { location / { proxy_pass https://e-hentai-lb/; + proxy_set_header Connection ""; proxy_next_upstream_timeout 100; proxy_connect_timeout 10; + keepalive_timeout 120; include proxy.params; } } @@ -76,6 +83,8 @@ server { location / { proxy_pass https://94.100.18.243:443/; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } } @@ -83,8 +92,8 @@ server { upstream api-e-hentai-lb { server 212.7.202.51:443; server 212.7.200.104:443; - keepalive 2; - keepalive_timeout 120s; + keepalive 16; + keepalive_timeout 120; keepalive_requests 10000; } @@ -100,6 +109,7 @@ server { location / { proxy_pass https://api-e-hentai-lb/; + proxy_set_header Connection ""; proxy_connect_timeout 10; include proxy.params; } @@ -127,20 +137,22 @@ server { fastcgi_send_timeout 3000; fastcgi_read_timeout 3000; proxy_pass https://upload-e-hentai-lb/; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } } upstream ehgt-org { - server 37.48.89.44:443; - server 81.171.10.48:443; - server 178.162.139.24:443; - server 178.162.140.212:443; - server [2001:1af8:4700:a062:9::47de]:443; - server [2001:1af8:4700:a062:8::47de]:443; - server [2001:1af8:4700:a0c9:4::47de]:443; - server [2001:1af8:4700:a0c9:3::47de]:443; - #server ehgt.c15412.tk:443; + server [2a00:7c80:0:12d::38a1]:443 max_fails=4 fail_timeout=60s; + server [2a00:7c80:0:13b::37a4]:443 max_fails=4 fail_timeout=60s; + server [2a00:7c80:0:123::3a85]:443 max_fails=4 fail_timeout=60s; + server 89.39.106.43:443 max_fails=4 fail_timeout=60s; + server 62.112.8.21:443 max_fails=4 fail_timeout=60s; + server 109.236.85.28:443 max_fails=4 fail_timeout=60s; + keepalive 16; + keepalive_timeout 120; + keepalive_requests 10000; } server { listen 443 ssl http2; @@ -155,7 +167,9 @@ server { location / { proxy_pass https://ehgt-org/; - proxy_connect_timeout 5; + proxy_set_header Connection ""; + proxy_connect_timeout 2; + keepalive_timeout 120; include proxy.params; } } diff --git a/conf/Pixiv.conf b/conf/Pixiv.conf index 5fb88e3..5b7366d 100644 --- a/conf/Pixiv.conf +++ b/conf/Pixiv.conf @@ -10,7 +10,7 @@ upstream www-pixiv-net { server 210.140.131.225:443; server 210.140.131.226:443; keepalive 16; - keepalive_timeout 120s; + keepalive_timeout 120; keepalive_requests 10000; } @@ -18,8 +18,8 @@ upstream account-pixiv-net { server 210.140.131.219:443; server 210.140.131.223:443; server 210.140.131.226:443; - keepalive 4; - keepalive_timeout 120s; + keepalive 16; + keepalive_timeout 120; keepalive_requests 10000; } @@ -33,8 +33,8 @@ upstream sketch-pixiv-net { server 210.140.174.37:443; server 210.140.170.179:443; server 210.140.175.130:443; - keepalive 3; - keepalive_timeout 120s; + keepalive 16; + keepalive_timeout 120; keepalive_requests 10000; } @@ -42,8 +42,8 @@ upstream sketch-hls-server { server 210.140.214.211:443; server 210.140.214.212:443; server 210.140.214.213:443; - keepalive 3; - keepalive_timeout 120s; + keepalive 16; + keepalive_timeout 120; keepalive_requests 10000; } @@ -52,8 +52,8 @@ upstream imgaz-pixiv-net { server 210.140.131.144:443; server 210.140.131.147:443; server 210.140.131.153:443; - keepalive 4; - keepalive_timeout 120s; + keepalive 16; + keepalive_timeout 120; keepalive_requests 10000; } @@ -82,7 +82,7 @@ upstream i-pximg-net { server 210.140.139.136:443; keepalive 16; - keepalive_timeout 120s; + keepalive_timeout 120; keepalive_requests 10000; } @@ -98,7 +98,7 @@ upstream fanbox-cc { server 210.140.92.187:443; keepalive 16; - keepalive_timeout 120s; + keepalive_timeout 120; keepalive_requests 10000; } @@ -149,6 +149,9 @@ server { location / { proxy_pass https://www-pixiv-net; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } } @@ -171,6 +174,9 @@ server { location / { proxy_pass https://account-pixiv-net/; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } } @@ -204,11 +210,11 @@ server { location / { proxy_pass https://i-pximg-net; - proxy_next_upstream_timeout 30; - proxy_connect_timeout 4; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; proxy_set_header Referer "https://www.pixiv.net/"; proxy_set_header Sec-Fetch-Site "cross-site"; - keepalive_timeout 120; include proxy.params; allow all; @@ -225,6 +231,9 @@ server { location / { proxy_pass https://fanbox-cc/; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; allow all; } @@ -239,6 +248,9 @@ server { location / { proxy_pass https://sketch-pixiv-net; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } @@ -295,6 +307,9 @@ server { location / { proxy_pass https://imgaz-pixiv-net; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } } @@ -471,6 +486,9 @@ server { location / { proxy_pass https://Github-com/; + keepalive_timeout 120; + proxy_set_header Connection ""; + proxy_connect_timeout 5; proxy_headers_hash_max_size 8192; proxy_buffer_size 128k; proxy_buffers 4 256k; @@ -492,9 +510,11 @@ server { location / { proxy_pass https://githubusercontent-com/; + keepalive_timeout 120; + proxy_set_header Connection ""; proxy_connect_timeout 4; - proxy_read_timeout 1; - proxy_send_timeout 1; + #proxy_read_timeout 1; + #proxy_send_timeout 1; proxy_next_upstream_timeout 32; proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; @@ -552,98 +572,3 @@ server { } # EA End -# my-freenom-com Start -server { - listen 443 ssl so_keepalive=on; - listen [::]:443 ssl so_keepalive=on; - server_name my.freenom.com; - - include cert.conf; - - location / { - #resolver 223.5.5.5 valid=600; - set $my_freenom_com lb-my-freenom-com-vpc-2022-1373795610.eu-west-1.elb.amazonaws.com; - proxy_pass https://$my_freenom_com/; - include proxy.params; - #proxy_ssl_name $my_freenom_com; - - #proxy_set_header Cookie $http_cookie; - proxy_connect_timeout 10; - proxy_send_timeout 120; - proxy_read_timeout 120; - } -} -# my-freenom-com End - - -# wix Start -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com; - server_name images-wixmp-530a50041672c69d335ba4cf.wixmp.com; - - include cert.conf; - - location / { - proxy_pass https://34.96.91.138:443/; - - include proxy.params; - - proxy_set_header Cookie $http_cookie; - proxy_connect_timeout 4; - proxy_send_timeout 4; - proxy_read_timeout 4; - } -} -# wix End - -# pixeldrain Start -upstream pixeldrain-com { - server 50.7.24.66:443; - server [2001:49f0:d0f6:8::2]:443; -} -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name pixeldrain.com; - - include cert.conf; - - location / { - proxy_pass https://pixeldrain-com/; - include proxy.params; - - proxy_set_header Cookie $http_cookie; - proxy_connect_timeout 4; - proxy_send_timeout 4; - proxy_read_timeout 4; - } -} -# pixeldrain End -# pixeldrain Start -upstream apkpure-com { - server [2606:4700:10::ac43:87f]:443; - server [2606:4700:10::6816:577]:443; - server [2606:4700:10::6816:477]:443; - server 104.22.4.119:443; - server 172.67.8.127:443; - server 104.22.5.119:443; -} -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name apkpure.com *.apkpure.com; - include cert.conf; - - location / { - proxy_pass https://apkpure-com/; - include proxy.params; - proxy_set_header Cookie $http_cookie; - proxy_ssl_name "${http_host}"; - proxy_connect_timeout 4; - proxy_send_timeout 4; - proxy_read_timeout 4; - } -} -# pixeldrain End diff --git a/conf/Reddit.conf b/conf/Reddit.conf index a38365f..9b74676 100644 --- a/conf/Reddit.conf +++ b/conf/Reddit.conf @@ -35,16 +35,15 @@ server { proxy_buffer_size 64k; proxy_buffers 32 64k; proxy_busy_buffers_size 128k; - keepalive_timeout 120; keepalive_requests 4000; proxy_pass https://Reddit/; + proxy_connect_timeout 5; + keepalive_timeout 120; proxy_set_header Connection ""; - proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; proxy_next_upstream error timeout http_429 http_500 http_502 http_503 http_504 non_idempotent; - proxy_connect_timeout 3; include proxy.params; } diff --git a/conf/Steam.conf b/conf/Steam.conf index 0cb44e6..b12368c 100644 --- a/conf/Steam.conf +++ b/conf/Steam.conf @@ -48,7 +48,7 @@ upstream steam-chat { #server humblebundle-a.akamaihd.net:443; #server eaassets-a.akamaihd.net:443; server 184.26.252.135:443; - #keepalive 8; + #keepalive 16; #keepalive_requests 10000; } @@ -115,10 +115,12 @@ server { error_log logs/SteamCDN-error.log; location / { - proxy_next_upstream_timeout 90; - proxy_connect_timeout 2; proxy_pass https://steam-store/; proxy_next_upstream error timeout http_403 http_429 http_500 http_502 http_503 http_504 non_idempotent; + proxy_next_upstream_timeout 90; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; #proxy_ssl_name $http_host; } @@ -165,7 +167,9 @@ server { proxy_pass https://steamstatic-akamai; proxy_http_version 1.1; proxy_next_upstream_timeout 60; - proxy_connect_timeout 3; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; proxy_next_upstream error timeout http_403 http_429 http_500 http_502 http_503 http_504 non_idempotent; proxy_set_header Host "community.steamstatic.com"; proxy_set_header User-Agent $http_user_agent; @@ -192,7 +196,9 @@ server { resolver public1.alidns.com valid=300 ipv4=on ipv6=off; #proxy_pass https://$rewrite_host; proxy_pass https://steamstatic-akamai; - proxy_connect_timeout 3s; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; proxy_ssl_name $http_host; access_log off; @@ -280,7 +286,9 @@ server { proxy_pass https://$rewrite_host; #proxy_pass https://steamstatic-akamai; proxy_http_version 1.1; - proxy_connect_timeout 3s; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; proxy_set_header Host "video.steamstatic.com"; proxy_set_header User-Agent $http_user_agent; proxy_set_header Accept-Encoding ''; @@ -305,7 +313,9 @@ server { resolver public1.alidns.com valid=300 ipv4=on ipv6=off; #proxy_pass https://$rewrite_host; proxy_pass https://steamstatic-akamai; - proxy_connect_timeout 3s; + proxy_connect_timeout 5; + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; #proxy_ssl_name $source_host; diff --git a/conf/SteamCDN..conf b/conf/SteamCDN..conf index 4053d93..c2a4c3c 100644 --- a/conf/SteamCDN..conf +++ b/conf/SteamCDN..conf @@ -1,7 +1,9 @@ resolver 119.29.29.29 valid=300 ipv4=on ipv6=on;# ipv4=on ipv6=off proxy_pass https://$rewrite_host; proxy_http_version 1.1; -proxy_connect_timeout 4s; +proxy_connect_timeout 3; +keepalive_timeout 120; +proxy_set_header Connection ""; proxy_set_header Host $rewrite_host; proxy_set_header User-Agent $http_user_agent; proxy_set_header Accept-Encoding ''; diff --git a/conf/Twitter.conf b/conf/Twitter.conf index 9adf7fa..22cb48b 100644 --- a/conf/Twitter.conf +++ b/conf/Twitter.conf @@ -70,7 +70,7 @@ upstream api-twitter-com { ##server 104.244.45.66:443; ##server 104.244.45.130:443; server 104.244.45.194:443; - keepalive 8; + keepalive 16; keepalive_time 1h; keepalive_timeout 600s; keepalive_requests 10000; @@ -152,7 +152,6 @@ server { tcp_nodelay on; proxy_set_header Cookie $http_cookie; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; include Twitter.params ; } } @@ -209,7 +208,7 @@ upstream twimg-com { server 199.232.232.160:443; keepalive 16; keepalive_time 1h; - keepalive_timeout 120s; + keepalive_timeout 120; keepalive_requests 1000; } @@ -222,7 +221,6 @@ server { location / { proxy_pass https://twimg-com/; include Twitter.params; - keepalive_timeout 120; } } diff --git a/conf/Twitter.params b/conf/Twitter.params index 9092613..b5647b6 100644 --- a/conf/Twitter.params +++ b/conf/Twitter.params @@ -4,5 +4,8 @@ proxy_headers_hash_max_size 8192; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; -proxy_connect_timeout 2; + +proxy_connect_timeout 5; +keepalive_timeout 120; +proxy_set_header Connection ""; include proxy.params; \ No newline at end of file diff --git a/conf/WallHaven.conf b/conf/WallHaven.conf index 91914f2..ca7b61a 100644 --- a/conf/WallHaven.conf +++ b/conf/WallHaven.conf @@ -3,6 +3,10 @@ upstream WallHaven-cc { server 15.235.80.145:443; + keepalive 16; + keepalive_time 1h; + keepalive_timeout 300s; + keepalive_requests 10000; } server { @@ -24,9 +28,9 @@ server { proxy_buffer_size 64k; proxy_buffers 32 64k; proxy_busy_buffers_size 128k; - #proxy_set_header X-Host $host; - #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - #proxy_set_header X-Real_IP $remote_addr; + + keepalive_timeout 120; + proxy_set_header Connection ""; include proxy.params; } } diff --git a/conf/nginx.conf b/conf/nginx.conf index 8179ca5..50308d1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,28 +1,25 @@ #user nobody; -#worker_cpu_affinity auto; -worker_processes 6; +worker_processes 2; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; +#pid logs/nginx.pid; events { - #use icop; - #multi_accept on; worker_connections 32767; } http { - resolver 223.5.5.5; - resolver_timeout 5s; + resolver 223.6.6.6; + resolver_timeout 10s; #include mime.types; #default_type application/octet-stream; ssl_protocols TLSv1.2 TLSv1.3 TLSv1 TLSv1.1 SSLv2 SSLv3; #ssl_ciphers "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256: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"; log_format main '[$time_local]- 客户端地址:"$remote_addr" 请求耗时"$request_time" 域名:$http_host 监听地址:$server_addr 监听端口:$server_port $server_protocol\n 上游状态"$upstream_status" 上游地址:"$upstream_addr" $status 总字节数$body_bytes_sent\n "$http_referer" "$http_x_forwarded_for" \n    "$request"\n';# "$http_user_agent" access_log logs/access.log main buffer=4k; - open_log_file_cache max=1000 inactive=1m valid=1m min_uses=1; fastcgi_buffers 16 128k; sendfile on; @@ -38,20 +35,16 @@ http { gzip on; include Pixiv.conf; include E-hentai.conf; - include Steam.conf; - #include DLsite.conf; - include Instagram.conf; - #include iwara.conf;#根据使用情况自行替换iwara.conf和iwara2.conf - include Reddit.conf; - include Discord.conf; - include Twitter.conf; - include Twitch.conf; - include WallHaven.conf; - #include Patreon.conf; - include PayPal.conf; - include nhentai.conf; - include WebUI.conf; - #include ShortLink.conf; - include GoogleVideo.conf; - + #include Steam.conf; + #include DLsite.conf;#目前已不需要,只改hosts就行了 + #include Reddit.conf; + #include Wallhaven.conf; + #include iwara.conf;#目前已不需要 + #include Discord.conf; + #include Twitter.conf; + #include Twitch.conf; + #include Instagram.conf; + #include PayPal.conf; + #include nhentai.conf; + #include GoogleVideo.conf; } \ No newline at end of file