Files
NexusAI/nginx.conf
ericwyuan eeccf36ab3 [任务5] 重构方案:用 OpenWebUI + LiteLLM 替换 One-API + MySQL
技术栈简化:
- 前端:One-API 网页管理 → OpenWebUI 极简界面(WEBUI_AUTH=False 无需登录,自动连接 LiteLLM)
- 网关:One-API(数据库驱动)→ LiteLLM(纯 YAML 配置驱动)
- 数据存储:MySQL(持久化) → LiteLLM 无状态(配置即代码)

配置简化:
- 不需要注册账号、不需要点网页添加渠道
- 所有 5 个渠道的定义、模型映射、优先级、Failover 规则写在 litellm-config.yaml
- API Key 填在 .env(占位符在 config.yaml 中引用)
- 用户体验:打开网页 → 输入问题 → 自动用最合适的模型回答

已部署到 NAS,openwebui 正在初始化数据库(首次启动需要 1-2 分钟)
2026-08-23 09:30:42 +08:00

54 lines
1.6 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.
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
# 域名/IP 未确定前,先用 _ 通配 server_name
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/certs/fullchain.pem;
ssl_certificate_key /etc/nginx/certs/privkey.pem;
location / {
proxy_pass http://openwebui: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;
# WebSocket 支持Infinity Chat 可能使用 WebSocket
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 关闭缓冲/缓存以支持流式输出
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 300s;
}
}
# 未映射 80 端口NAS 本机 80 已被其他服务占用,见 docker-compose.yml 注释)
# 公网仅通过甲骨文 frp 隧道转发 443 → 本机 8443暂不做 HTTP→HTTPS 跳转
}