You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.7 KiB

  1. # Example configuration file for HAProxy 2.0, refer to the url below for
  2. # a full documentation and examples for configuration:
  3. # https://cbonte.github.io/haproxy-dconv/2.0/configuration.html
  4. # Global parameters
  5. global
  6. # Log events to a remote syslog server at given address using the
  7. # specified facility and verbosity level. Multiple log options
  8. # are allowed.
  9. #log 10.0.0.1 daemon info
  10. # Specifiy the maximum number of allowed connections.
  11. maxconn 32000
  12. # Raise the ulimit for the maximum allowed number of open socket
  13. # descriptors per process. This is usually at least twice the
  14. # number of allowed connections (maxconn * 2 + nb_servers + 1) .
  15. ulimit-n 65535
  16. # Drop privileges (setuid, setgid), default is "root" on OpenWrt.
  17. uid 0
  18. gid 0
  19. # Perform chroot into the specified directory.
  20. #chroot /var/run/haproxy/
  21. # Daemonize on startup
  22. daemon
  23. nosplice
  24. # Enable debugging
  25. #debug
  26. # Spawn given number of processes and distribute load among them,
  27. # used for multi-core environments or to circumvent per-process
  28. # limits like number of open file descriptors. Default is 1.
  29. #nbproc 2
  30. # Default parameters
  31. defaults
  32. # Default timeouts
  33. timeout connect 5000ms
  34. timeout client 50000ms
  35. timeout server 50000ms
  36. # Example HTTP proxy listener
  37. listen my_http_proxy
  38. # Bind to port 81 and 444 on all interfaces (0.0.0.0)
  39. bind :81,:444
  40. # We're proxying HTTP here...
  41. mode http
  42. # Simple HTTP round robin over two servers using the specified
  43. # source ip 192.168.1.1 .
  44. balance roundrobin
  45. server server01 192.168.1.10:80 source 192.168.1.1
  46. server server02 192.168.1.20:80 source 192.168.1.1
  47. # Serve an internal statistics page on /stats:
  48. stats enable
  49. stats uri /stats
  50. # Enable HTTP basic auth for the statistics:
  51. stats realm HA_Stats
  52. stats auth username:password
  53. # Example SMTP proxy listener
  54. listen my_smtp_proxy
  55. # Disable this instance without commenting out the section.
  56. disabled
  57. # Bind to port 26 and 588 on localhost
  58. bind 127.0.0.1:26,127.0.0.1:588
  59. # This is a TCP proxy
  60. mode tcp
  61. # Round robin load balancing over two servers on port 123 forcing
  62. # the address 192.168.1.1 and port 25 as source.
  63. balance roundrobin
  64. #use next line for transparent proxy, so the servers can see the
  65. #original ip-address and remove source keyword in server definition
  66. #source 0.0.0.0 usesrc clientip
  67. server server01 192.168.1.10:123 source 192.168.1.1:25
  68. server server02 192.168.1.20:123 source 192.168.1.1:25
  69. # Special health check listener for integration with external load
  70. # balancers.
  71. listen local_health_check
  72. # Listen on port 60000
  73. bind :60000
  74. # This is a health check
  75. mode health
  76. # Enable HTTP-style responses: "HTTP/1.0 200 OK"
  77. # else just print "OK".
  78. #option httpchk