Skip to main content

Nginx 配置规范(WebUI 外部打开)

必须在 config.ini 同级创建 nginx 配置目录:

/usr/local/<app_id>/nginx/<app_id>.conf

内容模板:

location /<app_id>/ {
proxy_pass http://127.0.0.1:<listen_port>/;
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;
}

示例(weather 应用,端口 16688):

location /weather/ {
proxy_pass http://127.0.0.1:16688/;
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;
}