您好,登錄后才能下訂單哦!
今天測試配置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/stats defaults 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 3000 frontend h6_f bind *:80 mode http log global use_backend h6_server frontend h6_w bind *:443 mode tcp log global use_backend h6_four backend h6_four mode tcp balance roundrobin server h6_f1 10.29.25.11:443 weight 1 maxconn 10000 check inter 10s server h6_f2 10.30.20.9:443 weight 1 maxconn 10000 check inter 10s backend h6_server mode http balance roundrobin server h6_one 10.29.25.11:80 weight 1 maxconn 10000 check inter 10s server h6_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/stats defaults 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 3000 frontend h6_f bind *:80 mode http log global use_backend h6_server frontend h6_w bind *:443 ssl crt /etc/haproxy/ckl.pem mode http log global use_backend h6_four backend h6_four mode http balance roundrobin server h6_f1 10.29.25.11:443 weight 1 maxconn 10000 check inter 10s server h6_f2 10.30.20.9:443 weight 1 maxconn 10000 check inter 10s backend h6_server mode http balance roundrobin server h6_one 10.29.25.11:80 weight 1 maxconn 10000 check inter 10s server h6_tow 10.30.20.9:80 weight 1 maxconn 10000 check inter 10s
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。