Tengine 反向代理多个后端环境设置upstream retries等参数减少502错误

具体参数写法如下例

upstream opvps { server 192.168.100.1:8081; server 192.168.100.2:8081; server 192.168.100.3:8081; server 192.168.100.4:8081; keepalive 60; keepalive_timeout 60s; # 设置后端连接的最大idle时间为60s }

server {
    proxy_upstream_tries 3 ###重试3次;
    proxy_set_header Host $host;

    location / {
        proxy_pass opvps;}