kn4thx

haproxy2

Feb 8th, 2024
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1.  
  2.  
  3. frontend site1name
  4. bind 0.0.0.0:443 name 0.0.0.0:443 ssl crt-list /var/etc/haproxy/site1.crt_list
  5. mode http
  6. log global
  7. option http-keep-alive
  8. option forwardfor
  9. acl https ssl_fc
  10. http-request set-header X-Forwarded-Proto http if !https
  11. http-request set-header X-Forwarded-Proto https if https
  12. timeout client 30000
  13. acl site1 var(txn.txnhost) -m sub -i site1.ddns.org
  14. acl aclcrt_site1 var(txn.txnhost) -m reg -i ^site1name\ddns\.org(:([0-9]){1,5})?$
  15. http-request set-var(txn.txnhost) hdr(host)
  16. http-request add-header X-Forwarded-Proto https if aclcrt_site1name
  17. use_backend site1_ipvANY if site1name aclcrt_site1
  18. use_backend site1_ipvANY if aclcrt_site1
  19.  
  20. frontend site1name-http
  21. bind 0.0.0.0:80 name 0.0.0.0:80
  22. mode http
  23. log global
  24. option http-keep-alive
  25. option forwardfor
  26. acl https ssl_fc
  27. http-request set-header X-Forwarded-Proto http if !https
  28. http-request set-header X-Forwarded-Proto https if https
  29. timeout client 30000
  30. acl site1name-http var(txn.txnhost) -m sub -i site1.ddns.org
  31. http-request set-var(txn.txnhost) hdr(host)
  32. http-request redirect scheme https unless { ssl_fc }
  33. use_backend site1_ipvANY if site1name-http
  34. default_backend site1name_ipvANY
  35.  
  36.  
  37.  
  38. backend site1name_ipvANY
  39. mode http
  40. id 102
  41. log global
  42. http-check send meth GET
  43. timeout connect 30000
  44. timeout server 30000
  45. retries 3
  46. load-server-state-from-file global
  47. option httpchk
  48. server site1 192.168.20.11:80 id 103 check inter 1000
  49.  
  50.  
Add Comment
Please, Sign In to add comment