Files
hair/nginx/hair-gateway.conf
T
2026-06-14 15:04:34 +08:00

34 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 外网网关 nginx 配置
# 切换到网关时:把此文件链接到 /etc/nginx/sites-enabled/ 并重载 nginx
#
# 当前 hair.conf 代理 → 127.0.0.1:8000mock app
# 此文件代理 → 127.0.0.1:8080(网关)
# 切换时只需换 enabled 下的 symlink 即可。
server {
listen 80;
server_name hair.xiangsilian.com;
# 请求体大小限制(网关层兜底)
client_max_body_size 2m;
# 代理到网关
location / {
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 $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# 网关内部转发可能耗时较长(worker 处理 + 排队)
proxy_read_timeout 90s;
proxy_send_timeout 90s;
}
# 标注图直接由网关托管,nginx 不缓存小图
location /static/ {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
}
}