# global pidfile /var/run/haproxy.pid log 127.0.0.1 local0 log 127.0.0.1 local1 notice daemon user haproxy group haproxy stats socket /tmp/haproxy.socket user nobody group nobody mode 600 level admin node HAPROXY-APSS description HAPROXY-PHP-TOMCAT maxconn 40000 ulimit-n 102400 spread-checks 3 #quiet defaults log global option dontlognull #option tcp-smart-accept #option tcp-smart-connect retries 3 #option forwardfor # insert x-forwarded-for header so that app servers can see both proxy and client IPs option redispatch # any server can handle any session timeout client 60s timeout connect 9s timeout server 30s timeout check 5s #option http-server-close userlist shareaholic_admins user admin insecure-password rahasia # Real auth redacted listen APP bind *:80 mode http option dontlognull option tcp-smart-accept option tcp-smart-connect option http-server-close option http-pretend-keepalive option forwardfor option httplog balance roundrobin #balance source #option forwardfor except 127.0.0.1 mode http option httpchk balance roundrobin appsession PHPSESSID len 64 timeout 3h request-learn prefix cookie SRVNAME insert nocache indirect server www1 10.10.10.5:80 cookie www1 check server www2 10.10.10.6:80 cookie www2 check listen TOMCAT bind *:8080 mode http option dontlognull option tcp-smart-accept option tcp-smart-connect option http-server-close option http-pretend-keepalive option forwardfor option httplog balance roundrobin mode http option httpchk balance roundrobin cookie JSESSIONID prefix cookie SRVNAME insert nocache indirect server java1 10.10.10.5:8080 cookie java1 check server java2 10.10.10.6:8080 cookie java2 check listen STATS_PAGE *:9600 stats enable mode http stats refresh 60s stats uri /stats # Real path redacted stats realm Haproxy\ Statistics stats auth admin:password # Real credentials redacted monitor-uri /monitor # Returns 200 if we're up; real path redacted errorfile 503 /usr/share/haproxy/503.http