Files
hometown/docs/nginx-api反向代理.conf
2026-03-08 00:37:18 +08:00

13 lines
581 B
Plaintext
Raw Permalink 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.
# 将 /api 请求转发到本机 Node 后端(端口与 start-api.sh 一致,默认 5599
# 注意proxy_pass 末尾加 /,这样 /api/config 会转发为 /config后端路由无 /api 前缀)
# 把下面这段加入 server { ... } 内,建议放在 root 指令之后、其他 location 之前
location /api {
proxy_pass http://127.0.0.1:5599/;
proxy_http_version 1.1;
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;
}