haproxy.cfg 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. global
  2. log 127.0.0.1 local0 info
  3. maxconn 4096
  4. defaults
  5. option dontlognull # Do not log connections with no requests
  6. option contstats # Enable continuous traffic statistics updates
  7. retries 3 # Try to connect up to 3 times in case of failure
  8. timeout connect 5s # 5 seconds max to connect or to stay in queue
  9. timeout http-keep-alive 1s # 1 second max for the client to post next request
  10. timeout http-request 15s # 15 seconds max for the client to send a request
  11. timeout queue 30s # 30 seconds max queued on load balancer
  12. timeout client 30s # 客户端超时时间设置为30秒,你可以根据需要调整这个值
  13. timeout connect 10s # 连接超时时间设置为10秒,你也可以根据需要调整
  14. timeout server 30s # 服务端超时时间设置为30秒,根据需要调整
  15. backlog 10000 # Size of SYN backlog queue
  16. frontend ftp_fe
  17. bind 0.0.0.0:20-21 name ftp-control
  18. bind 0.0.0.0:21100-21110 name ftp-data
  19. mode tcp
  20. option tcplog
  21. log global
  22. default_backend ftp_be21
  23. backend ftp_be21
  24. balance leastconn
  25. stick on src
  26. stick-table type ip size 100k expire 1h
  27. server ftp-server1 47.98.251.134 check port 21
  28. listen nvr
  29. bind *:200
  30. mode http
  31. server s1 192.168.3.200:80 check
  32. listen car_plate
  33. bind *:98
  34. mode http
  35. server s98 192.168.3.98:80 check
  36. listen cops
  37. bind *:10166
  38. mode tcp
  39. server scops cops.uniquecharge.cn:2526 check