haproxy.cfg 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. global
  2. log stdout format raw local0 info
  3. maxconn 4096
  4. user haproxy
  5. group haproxy
  6. daemon
  7. defaults
  8. log global
  9. mode http
  10. option httplog
  11. option dontlognull
  12. timeout connect 5000
  13. timeout client 50000
  14. timeout server 50000
  15. option redispatch
  16. retries 3
  17. frontend http_front
  18. bind *:80
  19. mode http
  20. # 默认后端
  21. default_backend ankr_rpc
  22. backend ankr_rpc
  23. mode http
  24. balance roundrobin
  25. # 不添加 X-Forwarded-For 头,保持请求 IP 为服务器 IP
  26. # option forwardfor
  27. # 设置请求头
  28. http-request set-header Host rpc.ankr.com
  29. # 定义服务器 - 直接使用完整的 Ankr RPC 端点
  30. server ankr_server rpc.ankr.com:443 ssl verify none
  31. # 重写请求路径 - 添加 Ankr RPC 的特定路径前缀
  32. http-request set-path /solana/acadeb3212fbce5fa684b9e64410bdea04b416e32cc3b9a371d4073ecf30ebbb
  33. # 日志记录
  34. option httplog
  35. log global