mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
- add feedback backend, H5/admin UI, CRM services, and deployment docs - add isolated local test compose on port 18007 with separate data paths - remove committed LLM secret and support provider-specific env overrides Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
2.4 KiB
Text
61 lines
2.4 KiB
Text
# ============================================================
|
||
# 外网服务器 Nginx 配置 - feedback.new123.vip
|
||
# 业务链路: 浏览器 → Nginx (SSL终止) → frps → frpc → 本地 8007 (start.py)
|
||
# ============================================================
|
||
|
||
server {
|
||
listen 443 ssl http2;
|
||
server_name feedback.new123.vip;
|
||
|
||
# SSL 证书路径(按你实际位置改)
|
||
ssl_certificate /etc/nginx/ssl/feedback.new123.vip.pem;
|
||
ssl_certificate_key /etc/nginx/ssl/feedback.new123.vip.key;
|
||
|
||
# 替换成你的 frps 内网地址(如果 Nginx 和 frps 在同一台机器,就是 127.0.0.1:8007)
|
||
# 8007 是 frps 把流量转发到贾维斯本机的端口
|
||
set $frp_backend "127.0.0.1:8007";
|
||
|
||
# ============================================================
|
||
# 1. WebSocket 路径 /ws/ —— 前端实际使用的路径
|
||
# ============================================================
|
||
location /ws/ {
|
||
proxy_pass http://$frp_backend;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Upgrade $http_upgrade; # ★ WebSocket 关键
|
||
proxy_set_header Connection "upgrade"; # ★ WebSocket 关键
|
||
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 长连接超时(语音对话可能持续几分钟)
|
||
proxy_read_timeout 600s;
|
||
proxy_send_timeout 600s;
|
||
proxy_connect_timeout 30s;
|
||
|
||
# 禁用缓冲(实时音频流必需)
|
||
proxy_buffering off;
|
||
}
|
||
|
||
# ============================================================
|
||
# 2. 其他所有路径(HTML / API / OTA) → 普通 HTTP 代理
|
||
# ============================================================
|
||
location / {
|
||
proxy_pass http://$frp_backend;
|
||
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;
|
||
|
||
# API 也可能走长一点超时(AI 处理可能十几秒)
|
||
proxy_read_timeout 60s;
|
||
}
|
||
}
|
||
|
||
# HTTP → HTTPS 强制跳转
|
||
server {
|
||
listen 80;
|
||
server_name feedback.new123.vip;
|
||
return 301 https://$host$request_uri;
|
||
}
|