haproxy.cfg 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #---------------------------------------------------------------------
  2. # Example configuration for a possible web application. See the
  3. # full configuration options online.
  4. #
  5. # https://www.haproxy.org/download/1.8/doc/configuration.txt
  6. #
  7. #---------------------------------------------------------------------
  8. #---------------------------------------------------------------------
  9. # Global settings
  10. #---------------------------------------------------------------------
  11. global
  12. # to have these messages end up in /var/log/haproxy.log you will
  13. # need to:
  14. #
  15. # 1) configure syslog to accept network log events. This is done
  16. # by adding the '-r' option to the SYSLOGD_OPTIONS in
  17. # /etc/sysconfig/syslog
  18. #
  19. # 2) configure local2 events to go to the /var/log/haproxy.log
  20. # file. A line like the following can be added to
  21. # /etc/sysconfig/syslog
  22. #
  23. # local2.* /var/log/haproxy.log
  24. #
  25. log 127.0.0.1 local2
  26. chroot /var/lib/haproxy
  27. pidfile /var/run/haproxy.pid
  28. maxconn 4000
  29. user haproxy
  30. group haproxy
  31. daemon
  32. # turn on stats unix socket
  33. stats socket /var/lib/haproxy/stats level admin
  34. # utilize system-wide crypto-policies
  35. ssl-default-bind-ciphers PROFILE=SYSTEM
  36. ssl-default-server-ciphers PROFILE=SYSTEM
  37. #---------------------------------------------------------------------
  38. # common defaults that all the 'listen' and 'backend' sections will
  39. # use if not designated in their block
  40. #---------------------------------------------------------------------
  41. defaults
  42. mode http
  43. log global
  44. option httplog
  45. option dontlognull
  46. option http-server-close
  47. # option forwardfor except 127.0.0.0/8
  48. option redispatch
  49. retries 3
  50. timeout http-request 10s
  51. timeout queue 1m
  52. timeout connect 10s
  53. timeout client 1m
  54. timeout server 1m
  55. timeout http-keep-alive 10s
  56. timeout check 10s
  57. maxconn 3000
  58. frontend http-proxy
  59. bind *:443 ssl crt /etc/pki/haproxy/haproxy.pem
  60. http-request add-header X-Forwarded-Proto https
  61. default_backend classroom-web-farm
  62. backend classroom-web-farm
  63. balance roundrobin
  64. server serverc.lab.example.com 172.25.250.12:6081 send-proxy-v2 check inter 5s
  65. server serverd.lab.example.com 172.25.250.13:6081 send-proxy-v2 check inter 5s