haproxy筆記之一:Haproxy基本安裝配置(反向 Proxy,類似Nginx,可以代理tcp的串連,不只是http)(注意iptables和selinux的問題)

來源:互聯網
上載者:User

標籤:反向   debug   注意   isa   style   linux   amp   http   root   

1.安裝haproxy

yum -y install haproxy

2.設定檔
# this config needs haproxy-1.1.28 or haproxy-1.2.1 global        log 127.0.0.1   local0        log 127.0.0.1   local1 notice        #log loghost    local0 info        maxconn 4096        chroot /usr/share/haproxy        uid 99        gid 99        daemon        #debug        #quiet defaults        log     global        mode    http        option  httplog        option  dontlognull        retries 3        redispatch        maxconn 2000        contimeout      5000        clitimeout      50000        srvtimeout      50000 listen  appli1-rewrite 0.0.0.0:10001        cookie  SERVERID rewrite        balance roundrobin        server  app1_1 192.168.34.23:8080 cookie app1inst1 check inter 2000 rise 2 fall 5        server  app1_2 192.168.34.32:8080 cookie app1inst2 check inter 2000 rise 2 fall 5        server  app1_3 192.168.34.27:8080 cookie app1inst3 check inter 2000 rise 2 fall 5        server  app1_4 192.168.34.42:8080 cookie app1inst4 check inter 2000 rise 2 fall 5 listen  appli2-insert 0.0.0.0:10002        option  httpchk        balance roundrobin        cookie  SERVERID insert indirect nocache        server  inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3        server  inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3        capture cookie vgnvisitor= len 32         option  httpclose               # disable keep-alive        rspidel ^Set-cookie:\ IP=       # do not let this cookie tell our internal IP address listen  appli3-relais 0.0.0.0:10003        dispatch 192.168.135.17:80 listen  appli4-backup 0.0.0.0:10004        option  httpchk /index.html        option  persist        balance roundrobin        server  inst1 192.168.114.56:80 check inter 2000 fall 3        server  inst2 192.168.114.56:81 check inter 2000 fall 3 backup listen  ssl-relay 0.0.0.0:8443        option  ssl-hello-chk        balance source        server  inst1 192.168.110.56:443 check inter 2000 fall 3        server  inst2 192.168.110.57:443 check inter 2000 fall 3        server  back1 192.168.120.58:443 backup listen  appli5-backup 0.0.0.0:10005        option  httpchk *        balance roundrobin        cookie  SERVERID insert indirect nocache        server  inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3        server  inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3        server  inst3 192.168.114.57:80 backup check inter 2000 fall 3        capture cookie ASPSESSION len 32        srvtimeout      20000         option  httpclose               # disable keep-alive        option  checkcache              # block response if set-cookie & cacheable         rspidel ^Set-cookie:\ IP=       # do not let this cookie tell our internal IP address         errorloc        502     http://192.168.114.58/error502.html        errorfile       503     /etc/haproxy/errors/503.http

 

haproxy筆記之一:Haproxy基本安裝配置(反向 Proxy,類似Nginx,可以代理tcp的串連,不只是http)(注意iptables和selinux的問題)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.