Hi,

On Wed, Jun 14, Haim Ari wrote:
> yea, i tried that, does not work

Doesn't work how: path is not set to /Test or wrong backend is used or
something else ?
Have you tested with acl is_test path_beg instead of url_beg ?

For me these two configs work:

# version one using temp. header
frontend test4
        bind [email protected]:8080

        acl is_test url_beg  /Test
        acl is_test2 req.hdr(X-DUMMY) -m beg /Test

        http-request set-header X-DUMMY %[path] if is_test
        http-request set-path /Prod if is_test

        use_backend be_test if is_test2

        default_backend be_prod

backend be_test
        server dummytest ip.add.re.ss:80 id 1

backend be_prod
        server dummyprod ip2.add.re.ss:80 id 1


# version two set-path in backend (same as Jin Hu's example)
frontend test4
        bind [email protected]:8080

        acl is_test url_beg  /Test

        use_backend be_test if is_test
        default_backend be_notest

backend be_test
        acl is_test url_beg  /Test
        http-request set-path /Prod if is_test
        server dummytest ip.add.re.ss:80 id 1

backend be_prod
        server dummyprod ip2.add.re.ss:80 id 1

-Jarno

> ________________________________
> From: Jin Hu <[email protected]>
> Sent: Wednesday, June 14, 2017 1:20 PM
> To: Haim Ari
> Cc: [email protected]
> Subject: Re: rewrite URI
> 
> Hi,
> 
> I think you can achieve this by moving rewrite operations into backend 
> section, likes the following:
> 
> 
> frontend:
>     acl is_test url_beg  /Test
>     use_backend test if is_test
> 
> backend:
>     acl is_test url_beg  /Test
>     http-request set-path /Prod if is_test
> 
> 
> On Wed, Jun 14, 2017 at 5:08 PM, Haim Ari 
> <[email protected]<mailto:[email protected]>> wrote:
> 
> Hello,
> 
> 
> I'm would like to create an ACL that will rewrite the URI
> 
> 
> if the URI is "/Test"
> 
> https://test.example.com/Test<https:///geoEdgeTest>
> 
> 
> Change it to: /Prod
> 
> https://test.example.com/Prod
> 
> 
> But
> 
> At the same time also send it to a specific backend
> 
> Here is what I've tried but does not seem to work:
> 
> acl is_test url_beg  /Test
> use_backend test if is_test
> http-request set-path /Prod if is_test

-- 
Jarno Huuskonen

Reply via email to