20 lines
905 B
Plaintext
20 lines
905 B
Plaintext
# view.airtep.com 必须有的两段配置(避免 404)
|
||
# 在宝塔 → 网站 → view.airtep.com → 设置 → 配置文件 中,
|
||
# 在 server { } 内、且不要有重复或冲突的 location /api 或 location /api/ 。
|
||
# 只保留下面这一种 /api 反代,删掉任何 proxy_pass 到 3003 或别的端口的 location /api/ 。
|
||
|
||
# 1) 把 /api 开头的请求转到本机 5599(本项目 API)
|
||
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;
|
||
}
|
||
|
||
# 2) 若 api.config.json 被「禁止访问」规则误拦,可加下面这段(二选一,一般 root 正确即可)
|
||
# location = /api.config.json {
|
||
# alias /www/wwwroot/view.airtep.com/dist/api.config.json;
|
||
# }
|