9f15ff6f9e
mirror-to-gitee / mirror (push) Successful in 58s
原因 门户已拆分为独立仓 iotlcm-public/website(11:28 建仓,13:13 完成 fafc743「并入旧骨架独有价值内容,修 favicon 落地路径与过渡形态绑定」), 是门户的唯一事实来源。本仓6c8314a合并进来的 website/ 是拆分前的 旧骨架,继续保留会导致: - 两份门户代码持续漂移,同一问题要在两个仓各修一遍 - 单仓 compose / gateway / Makefile 里残留 with-website profile 与 /www/ 路由,与独立仓「门户自起容器、独立端口」的既定方案冲突 本提交 = revert -m 1 6c8314a,效果等同回到e98f856(git diffe98f856HEAD 为空)。回退点: tag backup/before-revert-portal-20261104 ->6c8314a门户部署改为(164 上,独立目录,不动 iotlcm-deploy): git clone https://git.5iot.com/iotlcm-public/website.git ~/iotlcm/website cd ~/iotlcm/website PORTAL_BIND_ADDR=0.0.0.0 docker compose -f deploy/docker-compose.yml up -d --build
73 lines
2.6 KiB
Nginx Configuration File
73 lines
2.6 KiB
Nginx Configuration File
# 单端口入口(默认对外 5051)
|
||
#
|
||
# 用途:把管理端、文档站、OpenAPI 收在一个端口下,便于在外部网关 / DNS
|
||
# 只暴露一个地址。编排里由 gateway 服务(profile: with-gateway)加载本文件,
|
||
# 容器内监听 80,宿主机发布端口用 GATEWAY_PORT 控制(默认 5051)。
|
||
#
|
||
# docker compose --profile with-gateway up -d
|
||
# GATEWAY_PORT=8088 docker compose --profile with-gateway up -d
|
||
#
|
||
# 路由:
|
||
# / -> 管理端(admin-ui,内部已代理 /api/ 到 admin-svr)
|
||
# /docs/ -> 文档站(docs)
|
||
# /openapi/ -> 对外 API(openapi)
|
||
# /route/open/ -> 运营商能力代理(openapi)
|
||
#
|
||
# 小程序 / H5 端的静态资源是根路径部署的,不能挂在同一域名的子路径下,
|
||
# 需要单独域名或单独端口(见 config/nginx/iotlcm.conf 的 app 段)。
|
||
|
||
# DNS 解析:nginx 默认只在启动时把 upstream 主机名解析一次,容器重建/重启换了 IP
|
||
# 就一直往旧地址打(2026-11-03 踩到:整站 /openapi 全 502,重启网关才恢复)。
|
||
# 127.0.0.11 是 Docker 内置 DNS;下面的 resolve + zone 让它在运行期自动跟随。
|
||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||
|
||
upstream gw_admin_ui { zone gw_admin_ui 64k; server admin-ui:80 resolve; }
|
||
upstream gw_openapi { zone gw_openapi 64k; server openapi:8000 resolve; }
|
||
upstream gw_docs { zone gw_docs 64k; server docs:80 resolve; }
|
||
|
||
server {
|
||
listen 80;
|
||
|
||
charset utf-8;
|
||
client_max_body_size 200m;
|
||
|
||
access_log /var/log/nginx/access_gateway.log;
|
||
error_log /var/log/nginx/error_gateway.log;
|
||
|
||
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;
|
||
proxy_read_timeout 120s;
|
||
proxy_send_timeout 120s;
|
||
|
||
# ---------- 文档站 ----------
|
||
location = /docs {
|
||
return 301 /docs/;
|
||
}
|
||
|
||
location ^~ /docs/ {
|
||
proxy_pass http://gw_docs;
|
||
}
|
||
|
||
# ---------- 对外 API:版本化接口 ----------
|
||
location ^~ /openapi/ {
|
||
proxy_pass http://gw_openapi;
|
||
}
|
||
|
||
# ---------- 对外 API:运营商能力代理(白名单 / 共享 Token)----------
|
||
location ^~ /route/open/ {
|
||
proxy_pass http://gw_openapi;
|
||
}
|
||
|
||
# ---------- 管理端(含 /api/ 与 /upload/,由 admin-ui 自行转发)----------
|
||
location / {
|
||
proxy_pass http://gw_admin_ui;
|
||
}
|
||
|
||
gzip on;
|
||
gzip_min_length 1k;
|
||
gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
|
||
}
|