Files
beaver_project/router-proxy/README.md
steven_li 53c42bb81b docs(README): 更新项目部署文档添加完整部署指南
更新 README.md 文件,提供详细的单机部署指南,包括:
- 完整的服务架构说明和请求链路图解
- 环境变量配置说明和示例
- 逐步部署流程(镜像构建、网络创建、服务启动)
- 健康检查和首次注册验收步骤
- 常见问题解答

同时更新各个子模块的 README 添加环境变量示例文件引用
2026-03-16 11:23:17 +08:00

53 lines
1.1 KiB
Markdown
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.

# router-proxy
独立的实例入口反向代理:
- 对外暴露一个统一端口
-`Host` 头把专属 URL 转发到对应 `app-instance` 容器
- 路由表从 `app-instance/runtime/registry/instances.json` 动态生成
## 文件
- `nginx.conf`
- Nginx 主配置
- `render-routes.py`
- 从实例注册表生成 `runtime/conf.d/instances.conf`
- `start-proxy.sh`
- 启动路由代理容器
- `reload-proxy.sh`
- 重载路由配置
## 默认约定
- 容器名:`nano-router-proxy`
- Docker network`nano-instance-edge`
- 对外端口:`8088`
建议直接参考:
- [`.env.example`](/home/ivan/xuan/nano_project/router-proxy/.env.example)
## 启动
```bash
cd /home/ivan/xuan/nano_project/router-proxy
./start-proxy.sh
```
## 重载
```bash
cd /home/ivan/xuan/nano_project/router-proxy
./reload-proxy.sh --start-if-missing
```
## URL 约定
如果 deploy-control 侧使用默认配置,实例 URL 形如:
```text
http://<instance-slug>.127.0.0.1.nip.io:8088
```
只要本机或 DNS 能把该域名解析到代理所在机器,就会由该代理转发到目标实例容器。