#feature:优化Bitwarden配置,集成健康检查和负载均衡策略
This commit is contained in:
@ -11,20 +11,6 @@ server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 配置上游服务列表
|
|
||||||
upstream backend_servers {
|
|
||||||
# 下面的 server 可以是你的多个后端服务,比如负载均衡后的几个实例
|
|
||||||
server router.tradewind.vip:10060;
|
|
||||||
# 可以添加更多的服务以实现更健壮的容错和负载均衡
|
|
||||||
|
|
||||||
# 设置健康检查参数
|
|
||||||
health_check;
|
|
||||||
health_check_port 10060; #需要确保健康检查的端口与访问端口相同
|
|
||||||
health_check_interval 2s; # 检查间隔
|
|
||||||
health_check_timeout 1s; # 超时时间,一般可以做得比较短
|
|
||||||
health_check_max_fails 1; # 失败多少次才认为服务不健康,可根据实际情况调整
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl http2;
|
listen 443 ssl http2;
|
||||||
listen [::]:443 ssl http2;
|
listen [::]:443 ssl http2;
|
||||||
@ -35,13 +21,13 @@ server {
|
|||||||
client_max_body_size 128M;
|
client_max_body_size 128M;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
set $router "backend_servers";
|
resolver 223.5.5.5;
|
||||||
|
set $router "router.tradewind.vip";
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
# 现在使用upstream定义的后端服务
|
proxy_pass http://$router:10060;
|
||||||
proxy_pass http://$router;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user