How to Set HAProxy Load Balancing Using Session Cookie

< Back to the Title Topic

How to Set HAProxy Load Balancing Using Session Cookie

Step 1: Locate the HA Proxy config file and execute the following command using your web server’s SSH terminal.

vi /etc/haproxy.cfg

Step 2: Edit the configuration file by adding the following codes.

listen http_proxy 192.168.0.1:80

    mode http

    balance roundrobin

    cookie SERVERID insert indirect nocache

    server web1 192.168.0.2:80 check cookie

    server web2 192.168.0.3:80 check cookie

Next How to Install memcached And libmemcached