haproxy 配置https

來源:互聯網
上載者:User

標籤:ha

今天測試組態haproxy代理https,一直報錯,後來發現,後端已經是https這裡則不需要特別指定了

設定檔如下:

global    log         127.0.0.1 local2    chroot      /var/lib/haproxy    pidfile     /var/run/haproxy.pid    maxconn     4000    user        haproxy    group       haproxy    daemon    stats socket /var/lib/haproxy/statsdefaults    mode                    http    log                     global    option                  httplog    option                  dontlognull    option http-server-close    option forwardfor       except 127.0.0.0/8    option                  redispatch    retries                 3    timeout http-request    10s    timeout queue           1m    timeout connect         10s    timeout client          1m    timeout server          1m    timeout http-keep-alive 10s    timeout check           10s    maxconn                 3000frontend            h5_f    bind            *:80    mode            http    log             global    use_backend     h5_serverfrontend            h5_w    bind            *:443    mode            tcp     log             global    use_backend     h5_fourbackend h5_four    mode            tcp    balance         roundrobin    server  h5_f1 10.29.25.11:443 weight 1 maxconn 10000 check inter 10s    server  h5_f2 10.30.20.9:443 weight 1 maxconn 10000 check inter 10sbackend h5_server    mode            http    balance         roundrobin    server  h5_one  10.29.25.11:80 weight 1 maxconn 10000 check inter 10s    server  h5_tow  10.30.20.9:80 weight 1 maxconn 10000 check inter 10s

如果後端沒有配置https則需要

global    log         127.0.0.1 local2    chroot      /var/lib/haproxy    pidfile     /var/run/haproxy.pid    maxconn     4000    user        haproxy    group       haproxy    daemon    stats socket /var/lib/haproxy/statsdefaults    mode                    http    log                     global    option                  httplog    option                  dontlognull    option http-server-close    option forwardfor       except 127.0.0.0/8    option                  redispatch    retries                 3    timeout http-request    10s    timeout queue           1m    timeout connect         10s    timeout client          1m    timeout server          1m    timeout http-keep-alive 10s    timeout check           10s    maxconn                 3000frontend            h5_f    bind            *:80    mode            http    log             global    use_backend     h5_serverfrontend            h5_w    bind            *:443 ssl crt /etc/haproxy/ckl.pem    mode            http     log             global    use_backend     h5_fourbackend h5_four    mode            http     balance         roundrobin    server  h5_f1 10.29.25.11:443 weight 1 maxconn 10000 check inter 10s    server  h5_f2 10.30.20.9:443 weight 1 maxconn 10000 check inter 10sbackend h5_server    mode            http    balance         roundrobin    server  h5_one  10.29.25.11:80 weight 1 maxconn 10000 check inter 10s    server  h5_tow  10.30.20.9:80 weight 1 maxconn 10000 check inter 10s


本文出自 “深呼吸再出擊” 部落格,請務必保留此出處http://ckl893.blog.51cto.com/8827818/1944926

haproxy 配置https

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.