Created
May 29, 2011 18:52
-
-
Save terrancesnyder/998039 to your computer and use it in GitHub Desktop.
haproxy.cfg - Example HAProxy Configuration
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
# /etc/haproxy.cfg | |
global | |
user haproxy | |
group haproxy | |
defaults | |
mode http | |
option forwardfor | |
option redispatch | |
retries 3 | |
maxconn 2000 | |
contimeout 5000 | |
clitimeout 30000 | |
srvtimeout 30000 | |
# solr backend | |
backend solr | |
reqirep ^GET\ /(.*) GET\ /apache-solr-3.1.0/\1 | |
balance roundrobin | |
option redispatch | |
option httpclose | |
cookie SERVERID insert nocache indirect | |
server <myserver> <myserver>:8080 cookie <myserver> check | |
stats uri /haproxy | |
stats realm haproxy | |
stats auth tomcat:tomcat | |
stats scope . | |
# default backend | |
backend default | |
balance roundrobin | |
option redispatch | |
option httpclose | |
cookie SERVERID insert nocache indirect | |
server <myserver> <myserver>:8080 cookie <myserver> check | |
stats uri /haproxy | |
stats realm haproxy | |
stats auth tomcat:tomcat | |
stats scope . | |
frontend default | |
bind *:80 | |
acl search.contoso.com hdr_end(host) -i search.contoso.com | |
acl builds.contoso.com hdr_end(host) -i builds.contoso.com | |
acl selenium.contoso.com hdr_end(host) -i selenium.contoso.com | |
acl _jenkins url_sub jenkins | |
acl _sonar url_sub sonar | |
acl _artifactory url_sub artifactory | |
use_backend jenkins if builds.contoso.com _jenkins | |
use_backend sonar if builds.contoso.com _sonar | |
use_backend artifactory if builds.contoso.com _artifactory | |
use_backend solr if search.contoso.com | |
use_backend seleniumgrid if selenium.contoso.com | |
default_backend default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/etc/haproxy/haproxy.cfg