Posted to openbsd by Bradipo at Mon Dec 12 22:11:06 GMT 2022view raw

  1. ext_addr="192.168.2.1"
  2. ext_if="em1"
  3. be1="192.168.1.2"
  4. be2="192.168.1.3"
  5. be3="192.168.1.4"
  6.  
  7. log state changes
  8. timeout 3000
  9.  
  10. table <backend> { $be1 $be2 $be3 }
  11.  
  12.  
  13. http protocol "backend" {
  14. match header set "X-Forwarded-For" value "$REMOTE_ADDR"
  15. match header set "X-Forwarded-By" value "$SERVER_ADDR:$SERVER_PORT"
  16. match header set "Keep-Alive" value "$TIMEOUT"
  17. pass
  18. tls keypair "relayd"
  19. }
  20.  
  21. relay "betls" {
  22. listen on $ext_addr port https tls
  23. protocol "backend"
  24. forward to <backend> port https mode loadbalance check script "/usr/local/bin/checkbackend.sh"
  25. }
  26.  
  27.  
  28. # relayctl show summary
  29. Id Type Name Avlblty Status
  30. 1 relay sgtls active
  31. 1 table backend:443 active (3 hosts)
  32. 1 host 192.168.1.2 100.00% up
  33. 2 host 192.168.1.3 100.00% up
  34. 3 host 192.168.1.4 100.00% up
  35.