Posts

Showing posts with the label HAProxy

HAProxy

Work at layer 7 Nginx  / Apache proxy: http, fastcgi Nginx: no heartbeat check HAProxy: http, mysql, service depending on port; Heartbeat check Env: three servers 1 HAProxy + 2 real server HAProxy: 192.168.199.183 Install Package: yum install haproxy config file: /etc/haproxy/haproxy.cfg vim /etc/haproxy/haproxy.cfg A. frontend --> nginx server B. backend   --> nginx upstream   acl: define static and dynamic use_backend <backend name> if <acl rule> Example: acl url_static path_beg -i /static /images /javascript /stylesheets acl url_static path_end -i .jpg .gif .png .css .js use_backend static if url_static backend static     balance roundrobin     server    server 127.0.0.1:4331 check Test1 state page (static apache service) without user authentication HAProxy server #vim /etc/haproxy/haproxy.cfg      frontend main *:80 #     acl url_...