Created
November 29, 2012 06:20
-
-
Save paulmars/4167127 to your computer and use it in GitHub Desktop.
Haproxy (two domains, two servers)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global | |
| log 127.0.0.1 local0 | |
| log 127.0.0.1 local1 notice | |
| #log loghost local0 info | |
| maxconn 4096 | |
| #chroot /usr/share/haproxy | |
| user haproxy | |
| group haproxy | |
| daemon | |
| #debug | |
| #quiet | |
| defaults | |
| log global | |
| mode http | |
| option httplog | |
| option dontlognull | |
| retries 3 | |
| option redispatch | |
| maxconn 2000 | |
| contimeout 5000 | |
| clitimeout 50000 | |
| srvtimeout 50000 | |
| frontend http_proxy | |
| bind *:80 | |
| acl is_bar hdr_dom(host) -i socialmoth.com | |
| acl is_foo hdr_dom(host) -i junojs | |
| use_backend cluster1 if is_bar | |
| use_backend cluster2 if is_foo | |
| default_backend cluster2 | |
| backend cluster1 | |
| server server1 127.0.0.1:3000 | |
| backend cluster2 | |
| server server2 127.0.0.1:2200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment