安全防护

This commit is contained in:
lu7213 committed 2026-11-16 02:09:23 -05:00
1 parent 1daf477899
commit 98657ace5b
25 files changed
+570 -4

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
# 合并到现有对外 server 中。使用 /prod-api 前缀的若依部署与直接路径均覆盖。
# 必须放在其他正则 location 前,且不能被现有 ^~ /prod-api/ 或精确 location 绕过。
# 合并后使用 nginx -T 核对实际命中的 location,再 nginx -t。
# 若前面还有 CDN/LB,仅对可信代理设置 real_ip;禁止信任全网的转发头。
location ~ ^/(?:prod-api/)?(?:monitor/(?:job|jobLog)|druid)(?:[/.;]|$) {
include /etc/nginx/snippets/usdt-admin-allow.conf;
# 与现有网关相同的 URI 去前缀行为,保留查询串。
rewrite ^/prod-api/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
# 如需整个管理站仅限 VPN,在独立管理域名的 server 级 include 上面的 allow 文件;
# 对外支付 API / OAuth 回调 / Telegram webhook 继续放在原公共 server,避免误封业务。