Files
openteam/deploy/nginx-public.conf
T
Sakurasan 5b67b66611 部署: 支持 .env 文件注入环境变量(OT_ 前缀), nginx-public 公网单端口配置
- config: loadDotEnv() 读取 .env 注入 os env, AutomaticEnv 统一映射 OT_ 前缀
- deploy/nginx-public.conf: 宿主 8088 单端口, 前端静态 + /api /v1 反代 loopback
  (SSE 关缓冲), host 网络避开 iptables DNAT
2026-08-15 13:17:29 +08:00

46 lines
1.4 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.
# openteam 公网部署(IP+端口方式):宿主 8088 单端口入口
# nginx 容器使用 host 网络,反代走 loopback 避开 DNAT 干扰
server {
listen 8088;
server_name _;
root /usr/share/nginx/html;
index index.html;
# SPA 路由回退
location / {
try_files $uri $uri/ /index.html;
}
# 管理 API + 代理端点 → 本机 openteam(127.0.0.1 loopback 不经 iptables DNAT)
location /api/ {
proxy_pass http://127.0.0.1:8080;
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 300s;
}
location /v1/ {
proxy_pass http://127.0.0.1:8080;
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;
# SSE 流式透传:关闭缓冲
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 300s;
}
# 静态资源缓存
location /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";
}
gzip on;
gzip_types text/plain text/css application/json application/javascript image/svg+xml;
}