linux - 502 Bad Gateway HAproxy -
i have ubuntu 12.04lts running. webserver tomcat 7.0.42 , use haproxy proxy server. application servlet application uses websockets.
sometime when request page "502 bad gateway" error on resources not on all, on some. think has haproxy configuration, following:
global maxconn 4096 # total max connections. dependent on ulimit nbproc 1 defaults mode http option http-server-close option httpclose # option redispatch no option checkcache # test against 502 error frontend 0.0.0.0:80 timeout client 86400000 default_backend www_backend acl is_websocket hdr(upgrade) -i websocket acl is_websocket hdr_beg(host) -i ws use_backend socket_backend if is_websocket backend www_backend balance roundrobin option forwardfor # sets x-forwarded-for timeout server 30000 timeout connect 4000 server apiserver localhost:8080 weight 1 maxconn 1024 check backend socket_backend balance roundrobin option forwardfor # sets x-forwarded-for timeout queue 5000 timeout server 86400000 timeout connect 86400000 server apiserver localhost:8080 weight 1 maxconn 1024 check what have change prevent 502 error?
first, enable haproxy logging. tell why giving 502's. guess backend "localhost:8080" not able keep or not able connection within 4000ms "timeout connect 4000".
Comments
Post a Comment