Hi.

Am 23-06-2016 18:49, schrieb Qingshan Xie:

Hello Team,
I'd like to convert a rewrite rule to a Haproxy ACL as below,
RewriteRule ^(.*)  http://<domain>/something/Search?q=/$1

I configured it as below but now working,

acl is_test base_reg test.xyz.com/(.*)
redirect location http://www.abc.com/$1 if is_test

Seems the (.*) cannot be passed as $1 from ACL to the service. Can some one help me what the right configuration should be?

the back reference in haproxy is \1

Maybe you want to use http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#redirect with http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#7.3.6-capture.req.uri


something like this.

http-request redirect code 301 location      \
  http://www.abc.com%[capture.req.uri]  \
  unless { hdr_beg(host) -i test.xyz.com }

Cheers
Aleks

Reply via email to