今天测试配置haproxy代理https,一直报错,后来发现,后端已经是https这里则不需要特别指定了

配置文件如下:

globallog127.0.0.1local2chroot/var/lib/haproxypidfile/var/run/haproxy.pidmaxconn4000userhaproxygrouphaproxydaemonstatssocket/var/lib/haproxy/statsdefaultsmodehttplogglobaloptionhttplogoptiondontlognulloptionhttp-server-closeoptionforwardforexcept127.0.0.0/8optionredispatchretries3timeouthttp-request10stimeoutqueue1mtimeoutconnect10stimeoutclient1mtimeoutserver1mtimeouthttp-keep-alive10stimeoutcheck10smaxconn3000frontendh6_fbind*:80modehttplogglobaluse_backendh6_serverfrontendh6_wbind*:443modetcplogglobaluse_backendh6_fourbackendh6_fourmodetcpbalanceroundrobinserverh6_f110.29.25.11:443weight1maxconn10000checkinter10sserverh6_f210.30.20.9:443weight1maxconn10000checkinter10sbackendh6_servermodehttpbalanceroundrobinserverh6_one10.29.25.11:80weight1maxconn10000checkinter10sserverh6_tow10.30.20.9:80weight1maxconn10000checkinter10s

如果后端没有配置https则需要

globallog127.0.0.1local2chroot/var/lib/haproxypidfile/var/run/haproxy.pidmaxconn4000userhaproxygrouphaproxydaemonstatssocket/var/lib/haproxy/statsdefaultsmodehttplogglobaloptionhttplogoptiondontlognulloptionhttp-server-closeoptionforwardforexcept127.0.0.0/8optionredispatchretries3timeouthttp-request10stimeoutqueue1mtimeoutconnect10stimeoutclient1mtimeoutserver1mtimeouthttp-keep-alive10stimeoutcheck10smaxconn3000frontendh6_fbind*:80modehttplogglobaluse_backendh6_serverfrontendh6_wbind*:443sslcrt/etc/haproxy/ckl.pemmodehttplogglobaluse_backendh6_fourbackendh6_fourmodehttpbalanceroundrobinserverh6_f110.29.25.11:443weight1maxconn10000checkinter10sserverh6_f210.30.20.9:443weight1maxconn10000checkinter10sbackendh6_servermodehttpbalanceroundrobinserverh6_one10.29.25.11:80weight1maxconn10000checkinter10sserverh6_tow10.30.20.9:80weight1maxconn10000checkinter10s