Centos haproxy获得的502错误太多
我的haproxy日志中出现了很多Centos haproxy获得的502错误太多,centos,haproxy,gateway,Centos,Haproxy,Gateway,我的haproxy日志中出现了很多“状态”:“502”错误,同时使用相同的url请求很好,状态为“200” 有线的事情是请求时间为零,似乎永远不要尝试建立连接 {“时间戳”:“2021-05-27T13:28:13+08:00”,“远程地址”: “101.200.28.###”、“请求uri”: “/pinsurvey/api/v1/projects/”,“协议”:“HTTP/1.1”,“请求方法”: “获取”、“发送状态”:“502”、“正文字节”: “568”、“http_x_forward
“状态”:“502”
错误,同时使用相同的url请求很好,状态为“200”
有线的事情是请求时间为零,似乎永远不要尝试建立连接
{“时间戳”:“2021-05-27T13:28:13+08:00”,“远程地址”:
“101.200.28.###”、“请求uri”:
“/pinsurvey/api/v1/projects/”,“协议”:“HTTP/1.1”,“请求方法”:
“获取”、“发送状态”:“502”、“正文字节”:
“568”、“http_x_forwarded_”:“112.103.45.###”、“http_referer”:
"https://servicewechat.com/wx0aa7dbf32636dc01/42/page-frame.html“,“请求时间”:
“0.000”,“上游响应时间”:“0.000:
0.000“,“上游地址”:“本地主机:本地主机”,“上游连接时间”:“0.000:
0.000“,“http_user_agent”:“Mozilla/5.0(Linux;Android 10;HRY-AL00Ta构建/HONORHRY-AL00Ta;wv)AppleWebKit/537.36(KHTML,类似
Gecko)版本/4.0 Chrome/78.0.3904.62 XWEB/2797 MMWEBDK/20210302
Mobile Safari/537.36 MMWEBID/7133
微传感器/8.0.3.1880(0x2800033D)过程/appbrand0微信/arm64
微信NetType/WIFI语言/zh_CN ABI/arm64微程序环境/android“}
这是我的haproxy.cfg文件:
global
log /dev/log local0
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 30000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listen stats
mode http
bind *:7992
stats refresh 30s
stats uri /stats
stats realm HAProxy Stats
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main
bind *:7879
# ez-admin-api
acl ez_admin_acl path_beg -i /ez-admin/
use_backend ez_admin if ez_admin_acl
# pinsurvey-api
acl pinsurvey_acl path_beg -i /pinsurvey/
use_backend pinsurvey if pinsurvey_acl
# ez-datamanagement-api
acl ez_datamanagement_acl path_beg -i /ez-datamanagement/
use_backend ez_datamanagement if ez_datamanagement_acl
default_backend ez_admin
backend ez_admin
http-request replace-path /ez-admin/(.*) /\1
balance roundrobin
server ez_admin_22 127.0.0.1:7807 check
server ez_admin_142 172.17.28.73:7807 check
backend pinsurvey
http-request replace-path /pinsurvey/(.*) /\1
balance roundrobin
server pinsurvey_159 172.17.28.66:7878 check
server pinsurvey_52 172.17.28.52:7878 check
server pinsurvey_124 123.56.241.124:7878 check
server pinsurvey_30 182.92.201.30:7878 check
server pinsurvey_34 172.17.117.34:7878 check
backend ez_datamanagement
http-request replace-path /ez-datamanagement/(.*) /\1
balance roundrobin
server ez_datamanagement_1 192.168.10.219:7801 check