Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4726

URL redirect with acl

$
0
0

Hello Experts

I am trying to archive URL redirect based on the pattern in URL.
Regex seems to be fine. I confirmed that with haproxy - Regex Tester/Debugger
But I am not able to achieve the expected redirection.
I am on HA-Proxy version 1.8.8-1ubuntu0.11

Any help on this would be really appreciated.

This what I want to achive:

Redirect All url with prefix Y to http://get.mysite.app

Y http://mysite.app
Y http://mysite.app/
N http://mysite.app/test
Y https://mysite.app
N https://mysite.app/test
Y www.mysite.app
N www.mysite.app/test

N http://get.mysite.app
N http://get.mysite.app/
N http://get.mysite.app/test
N https://get.mysite.app
N https://get.mysite.app/
N https://get.mysite.app/test
N www.get.mysite.app
N www.get.mysite.app/test

I tried this

This redirect all urls including /test
acl do_not_redirect_1 hdr(host) -m reg -i (.)mysite.app([/\ ])(\w)
acl do_not_redirect_2 hdr(host) -m reg -i (.
)get.mysite.app(.*)

No redirect achived
acl do_not_redirect_1 path_beg,url_dec -m beg -i /(\w*)
acl do_not_redirect_2 path,url_dec -m sub -i get.

    http-request redirect location https://get.mysite.app/ if !do_not_redirect_1 !do_not_redirect_2

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4726

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>