Hi Willy,

I am trying to setup HAProxy to filter incoming URL contents for a string
and if it does not contains, it will redirect to some other page.

My current configuration is
===================================
frontend HTTP
        bind 192.168.1.5:80
        acl ind url_sub index.html
        acl test url_sub testr
        acl url_slash url /
        redirect location /redirect.html if !ind or !test
        default_backend client1

backend client1
        server  client1-server 192.168.1.12:80 check inter 5m
====================================

My requirement is if URL contains exact word "testr" it should go normally
to backend client1 and show index.html.
If it doest not contains "testr" then it should show redirect.html.
But, if it contains "testrest" etc. still it should show redirect.html, I
mean the strict rule.
If URL contains nothing then also it should show redirect.html.

With above configuration
First condition matching partially, if it has "testr" it shows me
index.html page, but it shows me index.html with "testrrrrr" too.
Rest all condition it redirects it to redirect.html but it shows error in
browser "The page isn't redirecting properly".
Checked the real server in backend and explored in browser for
redirect.html, it shows the page properly.

Please help me with the configuration, if I am missing something or having
wrong configuration.


Also the below link is broken on the website http://haproxy.1wt.eu/ in
External Links (Installing HAProxy load-balancing for HTTP and
HTTPS<http://www.lastengine.com/99/installing-haproxy-load-balancing-for-http-and-https/>
)
http://www.lastengine.com/99/installing-haproxy-load-balancing-for-http-and-https/


Have a nice time,
Gourav Joshi
Have a look at www.linuxquestions.in

Reply via email to