Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. global
  2. log /dev/log daemon debug
  3. chroot /var/lib/haproxy
  4. stats socket /run/haproxy/admin.sock mode 660 level admin
  5. stats timeout 30s
  6. user haproxy
  7. group haproxy
  8. daemon
  9.  
  10. # Default SSL material locations
  11. ca-base /etc/ssl/certs
  12. crt-base /etc/ssl/private
  13.  
  14. # Default ciphers to use on SSL-enabled listening sockets.
  15. # For more information, see ciphers(1SSL).
  16. ssl-default-bind-ciphers kEECDH+aRSA+AES:kRSA+AES:+AES256:RC4-SHA:!kEDH:!LOW:!EXP:!MD5:!aNULL:!eNULL
  17. ssl-default-bind-options no-sslv3
  18.  
  19. defaults
  20. log global
  21. mode http
  22. option httplog
  23. timeout connect 5000
  24. timeout client 50000
  25. timeout server 50000
  26. errorfile 400 /etc/haproxy/errors/400.http
  27. errorfile 403 /etc/haproxy/errors/403.http
  28. errorfile 408 /etc/haproxy/errors/408.http
  29. errorfile 500 /etc/haproxy/errors/500.http
  30. errorfile 502 /etc/haproxy/errors/502.http
  31. errorfile 503 /etc/haproxy/errors/503.http
  32. errorfile 504 /etc/haproxy/errors/504.http
  33.  
  34. userlist users-customer1
  35. user cust1 insecure-password cust1
  36.  
  37. userlist users-customer2
  38. user cust2 insecure-password cust2
  39.  
  40. frontend carbon-in
  41. mode tcp
  42. option tcplog
  43. bind *:9300
  44. acl customer1_carbon src 192.168.1.39/32
  45. acl customer2_carbon src 192.168.1.54/32
  46. use_backend customer1-metronome if customer1_carbon
  47. use_backend customer2-metronome if customer2_carbon
  48.  
  49. backend customer1-metronome
  50. mode tcp
  51. option tcplog
  52. server customer1-metronome 127.0.0.1:9301
  53. option tcp-check
  54.  
  55. backend customer2-metronome
  56. mode tcp
  57. option tcplog
  58. server customer2-metronome 127.0.0.1:9302
  59. option tcp-check
  60.  
  61. frontend http-in
  62. log global
  63. mode http
  64. bind *:80
  65. acl customer1-auth-ok http_auth(users-customer1)
  66. acl customer2-auth-ok http_auth(users-customer2)
  67. http-request allow if customer1-auth-ok
  68. http-request auth realm PowerDNS if !customer1-auth-ok or !customer2-auth-ok
  69. http-request deny
  70. use_backend customer1-http if customer1-auth-ok
  71. use_backend customer2-http if customer2-auth-ok
  72.  
  73. backend customer1-http
  74. mode http
  75. server customer1-http 127.0.0.1:8001
  76. option tcp-check
  77.  
  78. backend customer2-http
  79. mode http
  80. server customer2-http 127.0.0.1:8002
  81. option tcp-check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement