haproxy 一端口多用(openvpn + ssh + https + http)(未经完整性测试)

来源:互联网 发布:sql union all 编辑:程序博客网 时间:2024/06/09 16:38
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 tcp#    client timeout 2s#    server timeout 2s #   connect timeout 2sfrontend sslmode tcpbind 0.0.0.0:22 name frontend-ssloption tcplogtcp-request inspect-delay 2stcp-request content accept if { req.ssl_hello_type 1 }tcp-request content accept if HTTPuse_backend localnginx if HTTPuse_backend main-ssl if { req.ssl_hello_type 1 }use_backend openvpn if !{ req.ssl_hello_type 1 } !{ req.len 0 }use_backend ssh if !{ req.ssl_hello_type 1 } { req.len 0 }backend openvpnmode tcpserver openvpn-localhost 127.0.0.1:9000timeout server 100hbackend sshmode tcpserver ssh-localhost 127.0.0.1:60022timeout server 100hbackend main-sslmode tcpserver main-ssl 127.0.0.1:8443timeout server 100hbackend localnginxmode httpserver default 127.0.0.1:80timeout server 100hoption forwardfor header sdf1haiwaioption forwardfor
0 0