This is the haproxy.cfg file I have been running for years on an Ubuntu
12 VPS, I just installed this on an Archlinux VPS and its not working.

Note:
    acl has_path path /
    reqirep ^([^\ :]*)\ /(.*) \1\ /ww/\2 if has_path
This is because its a Wt app and needs a url that starts off with a ww
in this case:
http://wittywizard.org/ww/en/blue/

and I do not want the www
    redirect prefix http://wittywizard.org code 301     if { hdr(host)
-i www.wittywizard.org }

wittywizard.org is on the new Archlinux VPS, the other sites are under the 
Ubuntu VPS

I am running monit.

If you see anything that needs to be changed or delete let me know, I am not 
very good at this, I just need it to work and need help.

Thanks for any help.

# nano -c /etc/haproxy/haproxy.cfg
global
    log 127.0.0.1 local0 
    log 127.0.0.1 local1 notice
    maxconn 4096
    user haproxy
    group haproxy
    daemon
defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    option  redispatch
    maxconn 1000
    timeout connect 5000
    timeout client 50000
    timeout server 50000
    option http-server-close
    timeout http-keep-alive 3000
    option forwardfor
frontend wt
    bind 216.117.149:80
    option http-server-close
    timeout http-keep-alive 3000
    reqidel ^Client-IP:.*
    reqidel ^X-Forwarded-For:.*
    option forwardfor
    # Set inside Witty Wizard main.cpp
    acl has_path path /
    reqirep ^([^\ :]*)\ /(.*) \1\ /ww/\2 if has_path
    redirect prefix http://wittywizard.org code 301         if {
hdr(host) -i www.wittywizard.org }
    redirect prefix http://lightwizzard.com code 301       if {
hdr(host) -i www.lightwizzard.com }
    redirect prefix http://thedarkwizzard.com code 301  if { hdr(host)
-i www.thedarkwizzard.com }
    redirect prefix http://greywizzard.com code 301       if {
hdr(host) -i www.greywizzard.com }
    redirect prefix http://rodremelin.com code 301        if {
hdr(host) -i www.rodremelin.com }
    # Note: see wthttpd.sh session-id-prefix
    acl srv1 url_sub wtd=wt-8060
    acl srv1_up nbsrv(bck1) gt 0
    use_backend bck1 if srv1_up srv1
    #
    # Second Thread
    # Note: see wthttpd.sh session-id-prefix
    # acl srv2  url_sub wtd=wt-8061
    # acl srv2_up nbsrv(bck2) gt 0
    # use_backend bck2 if srv2_up srv2 has_ww_uri
    #
    default_backend bck_lb
backend bck_lb
    balance roundrobin
    server srv1 216.117.149.91:8060 track bck1/srv1
    # server srv2 108.59.251.28:8060 track bck1/srv1
backend bck1
    balance roundrobin
    server srv1 216.117.149.91:8060 check
    # server srv2 108.59.251.28:8060 check
backend bck2
    balance roundrobin
    server srv2 216.117.149.91:8061 check
    # server srv2 108.59.251.28:8060 check
# EOF #

Reply via email to