@@@@@ /www/server/panel/vhost/nginx/alotbuy.com.conf # alotbuy.com —— DSH 平台站点(2026-09-10 建立,档案 21 场景延伸) # 走 Cloudflare 代理(橙云),故: # 1) 用 set_real_ip_from + CF-Connecting-IP 还原真实客户端 IP(否则日志/风控里全是 CF 的 IP) # 2) 80 端口「代理」而非 301:CF 若为 Flexible,源站 301 会造成 CF 侧循环;改成代理两种模式都能用 # —— 但**必须**把 CF 的 SSL/TLS 模式设为 Full (Strict),否则 CF→源站是明文(凭据裸奔) # 3) 继承 dsh 站点的关键优化:proxy_buffering off(流式)、gzip_proxied any(930KB bundle 压缩) # ---- HTTP:代理(不用 301,兼容 CF Flexible;Full (Strict) 下 80 不会被用到)---- server { # CF 回源 IP → 还原真实客户端 IP(仅本 server 生效) 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; 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; real_ip_header CF-Connecting-IP; listen 80; server_name alotbuy.com www.alotbuy.com *.alotbuy.com; # 2026-09-13:3 个跳转桩页已删除(档案 80 第 7 项 / 档案 81 §四)—— 保留 301 防旧书签 404 location = /desktop.html { return 301 /portal.html; } location = /plugins.html { return 301 /portal.html#/plugins; } location = /skills.html { return 301 /portal.html#/skills; } location / { proxy_pass http://127.0.0.1:3080; 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_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_read_timeout 3600s; proxy_buffering off; proxy_cache off; gzip_proxied any; } access_log /www/wwwlogs/alotbuy.com.log; error_log /www/wwwlogs/alotbuy.com.error.log; } # ---- HTTPS:门户 + 用户实例子域 ---- server { # CF 回源 IP → 还原真实客户端 IP(仅本 server 生效) 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; 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; real_ip_header CF-Connecting-IP; listen 443 ssl; http2 on; server_name alotbuy.com www.alotbuy.com *.alotbuy.com; ssl_certificate /etc/letsencrypt/live/alotbuy.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/alotbuy.com/privkey.pem; # 2026-09-13:3 个跳转桩页已删除(档案 80 第 7 项 / 档案 81 §四)—— 保留 301 防旧书签 404 location = /desktop.html { return 301 /portal.html; } location = /plugins.html { return 301 /portal.html#/plugins; } location = /skills.html { return 301 /portal.html#/skills; } # ── DSH 覆盖网络中继(自研 relay)──────────────────────────────── # 只在既有 443 server 块里加一个 location:不新增监听口、不新增证书、不动门户其它路径。 # `/status` 不在此前缀下 ⇒ 不会被代理出去(relay 端也只认 RELAY_PATH 前缀)。 location /dshs-relay { proxy_pass http://127.0.0.1:20080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host; proxy_read_timeout 3600s; proxy_send_timeout 3600s; proxy_buffering off; } location / { proxy_pass http://127.0.0.1:3080; 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_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_read_timeout 3600s; # 流式(dsh 回复/思考逐块下发)+ 反代压缩 + 解除缓冲 proxy_buffering off; proxy_cache off; proxy_send_timeout 3600s; gzip_proxied any; } # 内容哈希命名的静态资源 → 长缓存 location ~* ^/assets/ { proxy_pass http://127.0.0.1:3080; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_buffering off; gzip_proxied any; expires 30d; } access_log /www/wwwlogs/alotbuy.com.log; error_log /www/wwwlogs/alotbuy.com.error.log; } @@@@@ /www/server/panel/vhost/nginx/dsh.alotbuy.com.conf # dsh.alotbuy.com —— 旧域名(2026-09-10 平台迁移到 alotbuy.com 后仅做 301 跳转) # 用 map + 通配 server_name(比正则 server_name 更稳),保留用户名映射: # admin.dsh.alotbuy.com → admin.alotbuy.com # dsh.alotbuy.com → alotbuy.com # map 必须位于 http 上下文 —— 面板 vhost 文件正是被 include 在 http{} 内,故写在本文件顶层。 map $host $alotbuy_new_host { default alotbuy.com; ~^(?