Files
iotlcm/deploy/config/gateway/nginx.conf
T
MiFaZhan fd42b5976e
mirror-to-gitee / mirror (push) Successful in 4s
trigger-jenkins-oss / trigger (push) Successful in 0s
docs: 重写 README(用户视角,含手册跳转)+ 去掉「开源版」措辞 + 单端口入口 5051
README
- 标题去掉「(开源版)」:对使用者就是 iotLCM
- 新增「文档」表:使用手册(Web 端 / 小程序端)、部署手册、OpenAPI 合同、
  共享 Token 接口,全部指向仓内 docs/ 路径;并给出部署后的文档站地址
- 补功能概览、服务构成(带镜像 tag)、从源码构建、版本与镜像、许可

去措辞
- Gitee 建仓描述同步去掉「(开源版)」

单端口入口(新增,对外默认 5051)
- deploy/config/gateway/nginx.conf:/ → 管理端、/docs/ → 文档站、
  /openapi/ 与 /route/open/ → openapi
- compose 增加 gateway 服务(profile with-gateway),端口由 GATEWAY_PORT 控制
  实测:/ 200、/docs/ 200(含静态资源)、/api/agent/dept/list 200、
  /api/system/auth/login 返回后端真实 JSON
- nginx profile 的 80 端口改为可配 NGINX_HTTP_PORT(文档早有提及但 compose 写死)
- 部署手册概览页修正过期内容(schema 单文件、服务清单补全)、optional 增单端口入口段
2026-11-02 14:57:57 +08:00

68 lines
2.2 KiB
Nginx Configuration File
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.
# 单端口入口(默认对外 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 段)。
upstream gw_admin_ui { server admin-ui:80; }
upstream gw_openapi { server openapi:8000; }
upstream gw_docs { server docs:80; }
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;
}