Files
hometown/docs/nginx-宝塔站点示例.conf
2026-03-08 00:37:18 +08:00

26 lines
948 B
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 配置示例(可与「反向代理」界面等效)
# 使用前请替换:
# - server_name你的域名或 IP
# - root你的项目 dist 目录绝对路径(与宝塔「网站根目录」一致)
# 保存后:宝塔 → 网站 → 对应站点 → 设置 → 配置文件,粘贴或合并到 server { } 内,然后重载 Nginx。
server {
listen 80;
server_name view.airtep.com; # 改成你的域名或 IP
root /www/wwwroot/view.airtep.com/720yun-offline/dist; # 改成你的 dist 绝对路径
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
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;
}
}