技术栈: - 前端:LobeChat(已稳定运行,模型列表仅显示 auto-vision/auto-text) - 网关:LiteLLM Proxy(纯 YAML 配置驱动,5 个渠道定义 + 自动优先级 + Failover) - 存储:无(LiteLLM 无状态,配置即代码) 简化点: - 删除 MySQL(LiteLLM 无需持久化配置数据库) - 删除 One-API 后台登录(LiteLLM 通过 litellm-config.yaml 配置) - 保留 LobeChat(功能完整、已验证稳定、用户体验好) 用户体验: 打开 https://129.146.203.203:3210 → 输入 Access Code → 问答(后台自动选最好的模型) 已部署并验证端到端可访问(HTTP 307 重定向正常)
54 lines
1.6 KiB
Nginx Configuration File
54 lines
1.6 KiB
Nginx Configuration File
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://lobe-chat:3210;
|
||
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 跳转
|
||
}
|