Guest User

Untitled

a guest
Aug 4th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.31 KB | None | 0 0
  1. #---------------------------------------------------------------------
  2. # Global settings
  3. #---------------------------------------------------------------------
  4. global
  5.     #log         127.0.0.1 local2 debug     #Log configuration
  6.     log /dev/log local0 info
  7.     log /dev/log local0 notice
  8.     debug
  9.     chroot      /var/lib/haproxy
  10.     pidfile     /var/run/haproxy.pid
  11.     maxconn     4000
  12.     nbproc          2
  13.     cpu-map         1 0
  14.     cpu-map         2 1
  15.     user        haproxy             #Haproxy running under user and group "haproxy"
  16.     group       haproxy
  17.     daemon
  18.  
  19.     # turn on stats unix socket
  20.     stats socket /var/lib/haproxy/stats
  21.  
  22. #---------------------------------------------------------------------
  23. # common defaults that all the 'listen' and 'backend' sections will
  24. # use if not designated in their block
  25. #---------------------------------------------------------------------
  26. defaults
  27.     mode                    http
  28.     log                     global
  29.     option                  httplog
  30.     option                  dontlognull
  31.     option http-server-close
  32.     option http-buffer-request
  33.     option forwardfor
  34.     option http-server-close
  35.     option                  redispatch
  36.     retries                 3
  37.     timeout http-request    10s
  38.     timeout queue           1m
  39.     timeout connect         10s
  40.     timeout client          1m
  41.     timeout server          1m
  42.     timeout http-keep-alive 10s
  43.     timeout check           10s
  44. #---------------------------------------------------------------------
  45. #AProxy Monitoring Config
  46. #---------------------------------------------------------------------
  47. listen stats
  48.     bind 0.0.0.0:8443 ssl crt /etc/ssl/domain.cloud/domain.cloud.pem
  49.     stats enable
  50.     stats uri /
  51.     stats hide-version
  52.     stats admin if TRUE
  53.     stats refresh 30s
  54.  
  55. frontend ssl_relay
  56.     bind 0.0.0.0:443 ssl crt /etc/ssl/domain.cloud/domain.cloud.pem
  57.     # this only works with 1.5 haproxy
  58.     mode tcp
  59.     option clitcpka
  60.     option tcplog
  61.     option socket-stats
  62.     # option nolinger
  63.     maxconn  300
  64.  
  65.     tcp-request inspect-delay 5s
  66.     tcp-request content accept if { req_ssl_hello_type 1 }
  67.  
  68.     use_backend ssl_sp if { req_ssl_sni -i bts.domain.cloud }
  69.  
  70.     default_backend ssl_sp
  71.  
  72. backend ssl_sp
  73.    mode tcp
  74.    #option nolinger
  75.    option tcplog
  76.    #balance roundrobin
  77.    hash-type consistent
  78.    option srvtcpka
  79.  
  80.     # maximum SSL session ID length is 32 bytes.
  81.     stick-table type binary len 32 size 30k expire 30m
  82.  
  83.     # make sure we cover type 1 (fallback)
  84.     acl clienthello req_ssl_hello_type 1
  85.     acl serverhello rep_ssl_hello_type 2
  86.  
  87.     # use tcp content accepts to detects ssl client and server hello.
  88.     tcp-request inspect-delay 5s
  89.     tcp-request content accept if clienthello
  90.  
  91.     # no timeout on response inspect delay by default.
  92.     tcp-response content accept if serverhello
  93.  
  94.     # SSL session ID (SSLID) may be present on a client or server hello.
  95.     # Its length is coded on 1 byte at offset 43 and its value starts
  96.     # at offset 44.
  97.     # Match and learn on request if client hello.
  98.     stick on payload_lv(43,1) if clienthello
  99.  
  100.     # Learn on response if server hello.
  101.     stick store-response payload_lv(43,1) if serverhello
  102.  
  103.     #option ssl-hello-chk
  104.  
  105.     server x_sp 10.50.3.23:443  ssl verify none check
Advertisement
Add Comment
Please, Sign In to add comment