Files
dsh_ai1net_server/poc/im-connection-gateway/nginx-location.conf
T
admin e6207aa691
build / build-and-scan (push) Canceled after 0s
chore(仓库对齐): 文档库结构治理 + IM/插件线落地
文档库:目录改为编号制(01-规范/02-架构设计/03-数据库/04-调整方案/
05-交接单/06-ops/07-scripts/08-skills/09-archive),顶层散文件归入 01-规范/;
INDEX.md 与 docs-manifest.json 重刷(档案 146 篇);旧目录名引用全量对齐。

IM 线:src/im/**(SDK / hub / store / presence / ws / gateway-token)、
src/web/routes/im.ts、src/db/plugin-data/**、src/supervisor/plugin-assembly.ts
及对应 test/**。

插件线:poc/{im-agent-bridge,im-connection-gateway,im-conversation-tabs,
business-plugins-im,carbon-mcp-probe}、src/web/routes/{sessions,overlay-device}.ts、
src/net/relay/{device-grant,instance-credential}.ts。

仓库卫生:清出 40 个历史误入库 / 已改名文件(34 个交接单归档 + 6 个旧结构,
本地均有副本);dsh-server-docs/.gitignore 补 tmp/;交接单不入库(政策)。
2026-09-24 07:25:16 +08:00

41 lines
1.9 KiB
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.
# IM 线 · 第 12 棒 —— 外部连接层的**边缘映射**示例(nginx)。
#
# 🔻 第 15 棒更新(2026-09-23):本文件已**落到 47** `/opt/dsh-gateway/nginx-location.conf`
# 并用临时配置跑过 `nginx -t`(rc=0,见回报 §15.8);⛔ 但**仍未接进生效中的 vhost**
# —— 开流量属"改线上连接层",是单独一步。
# 落点提示:生效站点 = `ai1net.com.conf` 的 443 server 块(`location / → 127.0.0.1:3080`),
# 把本文件的 location 插在它**之前**即可;`$connection_upgrade` 该机已存在
# (`/www/server/panel/vhost/nginx/0.websocket.conf`)。
#
# 作用:客户端侧的 URL `/api/im/ws` **一个字都不变**,由边缘把它转到外部连接层的
# WebSocket 端点;平台进程内那条 `/api/im/ws` 仍然保留(实例内凭据通道 + 回滚路径)。
#
# ⚠️ 前提:`$connection_upgrade` 这个 map 必须在 `http {}` 里存在一次(宝塔/常见发行版
# 的默认配置里通常已有;没有就补下面这段):
#
# map $http_upgrade $connection_upgrade {
# default upgrade;
# '' close;
# }
location = /api/im/ws {
# 外部连接层的客户端通道(示例端口,按实际部署改)
proxy_pass http://127.0.0.1:18081/connection/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# 长连接:⛔ 不要开缓冲,读超时要大于一次保活间隔(垫片默认 8.7 s)
proxy_buffering off;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
# 连接层不落平台日志;排障看连接层自己的日志与 /metrics
access_log off;
}
# 回滚(一行):注释掉上面的 location ⇒ 请求落回平台进程内的 `/api/im/ws`。