负载均衡基本改造,增加redis、miniio等基本中间件

This commit is contained in:
2026-02-24 11:16:03 +08:00
parent 26677972a6
commit 8d711dc3a2
13 changed files with 317 additions and 63 deletions

View File

@@ -40,6 +40,17 @@ http {
# text/javascript; #设置压缩的文件类型
# gzip_vary on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# 如需多机负载均衡,在此增加多个后端地址
upstream easyflow_api {
server easyflow-api:8080;
keepalive 64;
}
server {
listen 8080;
server_name localhost;
@@ -60,20 +71,47 @@ http {
}
}
location /api/ {
proxy_pass http://easyflow-api:8080;
# WebSocket语音链路
location /api/v1/bot/ws/audio {
proxy_pass http://easyflow_api;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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 3600s;
proxy_send_timeout 3600s;
}
# SSE/HTTP API
location /api/ {
proxy_pass http://easyflow_api;
proxy_http_version 1.1;
proxy_set_header Connection "";
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 3600s;
proxy_send_timeout 3600s;
proxy_buffering off;
proxy_cache off;
}
location /userCenter/ {
proxy_pass http://easyflow-api:8080;
proxy_pass http://easyflow_api;
proxy_http_version 1.1;
proxy_set_header Connection "";
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 3600s;
proxy_send_timeout 3600s;
proxy_buffering off;
proxy_cache off;
}
error_page 500 502 503 504 /50x.html;