Re: acl regex

2015-11-24 Thread Guillaume Bourque
Hi all,

I should be able to test this in our production setup a few days after I can 
have an rpm ready with the patch we are running on rhel 6.x

Merci Cyril


---
Guillaume Bourque, B.Sc.,


Le 2015-11-24 à 16:58, Cyril Bonté  a écrit :

> Hi all,
> 
> I revive this thread.
> 
> Le 12/11/2015 09:59, Igor Cicimov a écrit :
>> 
>> 
>> On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque
>> > > wrote:
>> 
>>Hi,
>> 
>>thanks for the suggestion but it did not work for me.   I tried
>> 
>>acl fr_top  url_reg/?lang=
>>acl fr_top  url_reg/?lang=$
>> # off acl fr_topurlp_reg(lang\=$,?)
>> -m found
>> # off acl fr_topurlp_reg(lang\=$,?)
>> -m found
>> 
>>but with no luck
> 
> I think that using "urlp" should have done the job but that the 
> implementation in haproxy is not correct for one specific case.
> 
> Currently, haproxy won't match an url parameter if its value is empty. I tend 
> to think it should : an empty value is different from not providing the 
> parameter at all.
> 
> The function "find_next_url_param()" should unconditionally return "1" when a 
> parameter is found, instead of "value_end != value_start" :
> http://www.haproxy.org/git?p=haproxy.git;a=blob;f=src/proto_http.c;h=77a52078d0d0d458ed7f0233dfda87eca247d2c2;hb=HEAD#l11661
> 
> This would allow some rules like :
>acl LANG_FR_NONE urlp_reg(lang) ^(fr)?$
>acl LANG_EN  urlp(lang) en
> 
>http-request redirect location /if { path / } LANG_FR_NONE
>http-request redirect location /en  if { path / } LANG_EN
> 
> 
> If it's ok for everyone, I can provide a small patch (which will also fix 
> some invalid code comments on top of this function).
> 
> 
> -- 
> Cyril Bonté



Re: acl regex

2015-11-24 Thread Cyril Bonté

Hi all,

I revive this thread.

Le 12/11/2015 09:59, Igor Cicimov a écrit :



On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque
> wrote:

Hi,

thanks for the suggestion but it did not work for me.   I tried

acl fr_top  url_reg/?lang=
acl fr_top  url_reg/?lang=$
 # off acl fr_topurlp_reg(lang\=$,?)
 -m found
 # off acl fr_topurlp_reg(lang\=$,?)
 -m found

but with no luck


I think that using "urlp" should have done the job but that the 
implementation in haproxy is not correct for one specific case.


Currently, haproxy won't match an url parameter if its value is empty. I 
tend to think it should : an empty value is different from not providing 
the parameter at all.


The function "find_next_url_param()" should unconditionally return "1" 
when a parameter is found, instead of "value_end != value_start" :

http://www.haproxy.org/git?p=haproxy.git;a=blob;f=src/proto_http.c;h=77a52078d0d0d458ed7f0233dfda87eca247d2c2;hb=HEAD#l11661

This would allow some rules like :
acl LANG_FR_NONE urlp_reg(lang) ^(fr)?$
acl LANG_EN  urlp(lang) en

http-request redirect location /if { path / } LANG_FR_NONE
http-request redirect location /en  if { path / } LANG_EN


If it's ok for everyone, I can provide a small patch (which will also 
fix some invalid code comments on top of this function).



--
Cyril Bonté



Re: acl regex

2015-11-24 Thread Willy Tarreau
Hi Cyril,

On Tue, Nov 24, 2015 at 10:58:47PM +0100, Cyril Bonté wrote:
> Currently, haproxy won't match an url parameter if its value is empty. I 
> tend to think it should : an empty value is different from not providing 
> the parameter at all.
> 
> The function "find_next_url_param()" should unconditionally return "1" 
> when a parameter is found, instead of "value_end != value_start" :
> http://www.haproxy.org/git?p=haproxy.git;a=blob;f=src/proto_http.c;h=77a52078d0d0d458ed7f0233dfda87eca247d2c2;hb=HEAD#l11661
> 
> This would allow some rules like :
> acl LANG_FR_NONE urlp_reg(lang) ^(fr)?$
> acl LANG_EN  urlp(lang) en
> 
> http-request redirect location /if { path / } LANG_FR_NONE
> http-request redirect location /en  if { path / } LANG_EN
> 
> 
> If it's ok for everyone, I can provide a small patch (which will also 
> fix some invalid code comments on top of this function).

I totally agree with you, and BTW your proposal is the only way to make
"url_p(lang) -m found" work. So you've found a real bug.

Thanks,
Willy




Re: acl regex

2015-11-12 Thread Guillaume Bourque
Hi all,

I’m not far but it does not work so any recommendation would be very helpfull

I just need some very simple redirect but after looking into aloa doc the happy 
doc, I can’t find examples that could help me do this, okay I must admit I did 
not sleep for the last 30 hours so that could explain why I can understand what 
I read ;-)


This seem the way to do it, but it do not work for me I’m running haproxy 1.5.4 

>> http-request redirect location /store code 301 if { capture.req.uri lang\= 
>> -m found }


here is what I need to do, I can do path rewrite fine, but the ? is bugging us.

I need to redirect 301 client from this

http://domain.com/?lang=to   
http://domain.com/
http://domain.com/?lang=fr  to   
http://domain.com/
http://domain.com/?lang=en  to   
http://domain.com/en
http://domain.com/pages/magasin.php?lang=fr to   http://domain.com/

It  can be on 3 differents lines I dont want to achieve light speed performance 
I just need to have this working ASAP

So I try with this

http-request redirect location /store code 301 if { capture.req.uri lang= -m 
found }

Or with an acl 

acl fr_topurlp_reg(lang\=$,?) -m found
http-request redirect location http://www.braultetmartineau.com/ code 301 if 
fr_top

Do I need to escape anything in there 

Any advice would be very appreciated

Thanks

---
Guillaume Bourque, B.Sc.,


Le 2015-11-12 à 05:04, Guillaume Bourque  a 
écrit :

> Hello Igor,
> 
> thanks a lot still not working 
> 
> would I need to escape the = 
> 
>> http-request redirect location /store code 301 if { capture.req.uri lang\= 
>> -m found }
> 
> 
> Bye
> 
> ---
> Guillaume Bourque, B.Sc.,
> Le 2015-11-12 à 03:59, Igor Cicimov  a écrit :
> 
>> 
>> 
>> On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque 
>>  wrote:
>> Hi,
>> 
>> thanks for the suggestion but it did not work for me.   I tried
>> 
>>acl fr_top  url_reg/?lang=
>>acl fr_top  url_reg/?lang=$
>> # off acl fr_topurlp_reg(lang\=$,?) -m 
>> found
>> # off acl fr_topurlp_reg(lang\=$,?) -m 
>> found
>> 
>> but with no luck
>> 
>> thanks
>> 
>> ---
>> Guillaume Bourque, B.Sc.,
>> Le 2015-11-12 à 02:18, Igor Cicimov  a écrit 
>> :
>> 
>>> 
>>> On 12/11/2015 5:30 PM, "Guillaume Bourque" 
>>>  wrote:
>>> >
>>> > Hello Bryan
>>> >
>>> > I’m running haproxy 1.5.4 and I can’t find any example on how to user 
>>> > req.uri if you could give a examples on how to match a specific query to 
>>> > redirect to another 
>>> >
>>> > From http://domain/pages/store.php?lang=fr   to http://domain/store/
>>> >
>>> > That would be great !
>>> >
>>> > TIA
>>> >
>>> >
>>> >
>>> > ---
>>> > Guillaume Bourque, B.Sc.,
>>> >
>>> > Le 2015-11-12 à 00:42, Bryan Talbot  a écrit :
>>> >
>>> >> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque 
>>> >>  wrote:
>>> >>>
>>> >>> Hi all,
>>> >>>
>>> >>> I can’t create an acl that will match this
>>> >>>
>>> >>> http://domain/?lang=
>>> >>>
>>> >>> I tried
>>> >>>
>>> >>> acl fr_top  path_reg^/.lang\=$
>>> >>> acl fr_top  path_reg^/\?lang\=$
>>> >>>
>>> >>> acl fr_toppath_beg/?lang\=$
>>> >>>
>>> >>>
>>> >>
>>> >>
>>> >> You can't match the query string with the 'path' matcher. Try 'req.uri' 
>>> >> or 'query' if you're using 1.6. 
>>> >>
>>> >>
>>> >
>>> Try this:
>>> 
>>> acl fr_top  url_reg   /pages/store.php?lang=fr
>>> 
>> 
>> 
>> Ok, my last try :-)
>> 
>> http-request redirect location /store code 301 if { capture.req.uri lang= -m 
>> found }
>> 
>> 
>> 
> 



Re: acl regex

2015-11-12 Thread Guillaume Bourque
Hourra Aleks,

it’s working thanks a lot

I will try more in deep in a few hour but wanted to tank you as soon as I test 
it 

Again thanks 

---
Guillaume Bourque, B.Sc.,
Le 2015-11-12 à 16:19, Aleksandar Lazic  a écrit :

> Hi.
> 
> Am 12-11-2015 21:16, schrieb Guillaume Bourque:
>> Hi all,
>> I’m not far but it does not work so any recommendation would be very
>> helpfull
>> I just need some very simple redirect but after looking into aloa doc
>> the happy doc, I can’t find examples that could help me do this, okay
>> I must admit I did not sleep for the last 30 hours so that could explain
>> why I can understand what I read ;-)
>> This seem the way to do it, but it do not work for me I’m running
>> haproxy 1.5.4
 http-request redirect location /store code 301 if { capture.req.uri
 lang\= -m found }
>> here is what I need to do, I can do path rewrite fine, but the ? is
>> bugging us.
>> I need to redirect 301 client from this
>> http://domain.com/?lang= to http://domain.com/
>> http://domain.com/?lang=fr to http://domain.com/
>> http://domain.com/?lang=en to http://domain.com/en
>> http://domain.com/pages/magasin.php?lang=fr to http://domain.com/
>> It  can be on 3 differents lines I dont want to achieve light speed
>> performance I just need to have this working ASAP
>> So I try with this
>> http-request redirect location /store code 301 if { capture.req.uri
>> lang= -m found }
>> Or with an acl
>> acl fr_topurlp_reg(lang\=$,?) -m found
>> http-request redirect location http://www.braultetmartineau.com/ code
>> 301 if fr_top
>> Do I need to escape anything in there
>> Any advice would be very appreciated
> 
> How about to use a example from this.
> 
> http://git.haproxy.org/?p=haproxy-1.5.git;a=blob;f=examples/acl-content-sw.cfg;h=1872789ac2d1198f4321e77c0dad4f382cc8f206;hb=HEAD
> 
> 
> acl forbidden_uris url_reg -i 
> (\.php\?temppath=|\.php\?setmodules=|[=:]http://)
> block if forbidden_uris
> 
> 
> I would try this, untested.
> 
> acl redir_en  url_reg -i .*lang=en
> acl redir_empty_or_fr url_reg -i .*lang=($|fr)
> 
> redirect location http://domain.com/code 301 if redir_empty_or_fr
> redirect location http://domain.com/en/ code 301 if redir_en
> 
> Cheers
> Aleks
> 
>> Thanks
>> ---
>> Guillaume Bourque, B.Sc.,
>> Le 2015-11-12 à 05:04, Guillaume Bourque
>>  a écrit :
>>> Hello Igor,
>>> thanks a lot still not working
>>> would I need to escape the =
 http-request redirect location /store code 301 if { capture.req.uri
 lang\= -m found }
>>> Bye
>>> ---
>>> Guillaume Bourque, B.Sc.,
>>> Le 2015-11-12 à 03:59, Igor Cicimov 
>>> a écrit :
>>> On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque
>>>  wrote:
>>> Hi,
>>> thanks for the suggestion but it did not work for me.   I tried
>>> acl fr_top  url_reg/?lang=
>>> acl fr_top  url_reg/?lang=$
>>> # off acl fr_topurlp_reg(lang\=$,?)
>>> -m found
>>> # off acl fr_topurlp_reg(lang\=$,?)
>>> -m found
>>> but with no luck
>>> thanks
>>> ---
>>> Guillaume Bourque, B.Sc.,
>>> Le 2015-11-12 à 02:18, Igor Cicimov 
>>> a écrit :
>>> On 12/11/2015 5:30 PM, "Guillaume Bourque"
>>>  wrote:
 Hello Bryan
 I’m running haproxy 1.5.4 and I can’t find any example on how to
>>> user req.uri if you could give a examples on how to match a specific
>>> query to redirect to another
 From http://domain/pages/store.php?lang=fr   to http://domain/store/
 That would be great !
 TIA
 ---
 Guillaume Bourque, B.Sc.,
 Le 2015-11-12 à 00:42, Bryan Talbot  a
>>> écrit :
> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque
>>>  wrote:
>> Hi all,
>> I can’t create an acl that will match this
>> http://domain/?lang=
>> I tried
>> acl fr_top  path_reg^/.lang\=$
>> acl fr_top  path_reg
>>> ^/\?lang\=$
>> acl fr_toppath_beg
>>> /?lang\=$
> You can't match the query string with the 'path' matcher. Try
>>> 'req.uri' or 'query' if you're using 1.6.
>>> Try this:
>>> acl fr_top  url_reg   /pages/store.php?lang=fr
>> Ok, my last try :-)
>> http-request redirect location /store code 301 if { capture.req.uri
>> lang= -m found }



Re: acl regex

2015-11-12 Thread Aleksandar Lazic

Hi.

Am 12-11-2015 21:16, schrieb Guillaume Bourque:

Hi all,

I’m not far but it does not work so any recommendation would be very
helpfull

I just need some very simple redirect but after looking into aloa doc
the happy doc, I can’t find examples that could help me do this, okay
I must admit I did not sleep for the last 30 hours so that could 
explain

why I can understand what I read ;-)

This seem the way to do it, but it do not work for me I’m running
haproxy 1.5.4


http-request redirect location /store code 301 if { capture.req.uri
lang\= -m found }


here is what I need to do, I can do path rewrite fine, but the ? is
bugging us.

I need to redirect 301 client from this

http://domain.com/?lang= to http://domain.com/

http://domain.com/?lang=fr to http://domain.com/

http://domain.com/?lang=en to http://domain.com/en

http://domain.com/pages/magasin.php?lang=fr to http://domain.com/

It  can be on 3 differents lines I dont want to achieve light speed
performance I just need to have this working ASAP

So I try with this

http-request redirect location /store code 301 if { capture.req.uri
lang= -m found }

Or with an acl

acl fr_topurlp_reg(lang\=$,?) -m found
http-request redirect location http://www.braultetmartineau.com/ code
301 if fr_top

Do I need to escape anything in there

Any advice would be very appreciated


How about to use a example from this.

http://git.haproxy.org/?p=haproxy-1.5.git;a=blob;f=examples/acl-content-sw.cfg;h=1872789ac2d1198f4321e77c0dad4f382cc8f206;hb=HEAD


acl forbidden_uris url_reg -i 
(\.php\?temppath=|\.php\?setmodules=|[=:]http://)

block if forbidden_uris


I would try this, untested.

acl redir_en  url_reg -i .*lang=en
acl redir_empty_or_fr url_reg -i .*lang=($|fr)

redirect location http://domain.com/code 301 if redir_empty_or_fr
redirect location http://domain.com/en/ code 301 if redir_en

Cheers
Aleks


Thanks

---
Guillaume Bourque, B.Sc.,

Le 2015-11-12 à 05:04, Guillaume Bourque
 a écrit :


Hello Igor,

thanks a lot still not working

would I need to escape the =


http-request redirect location /store code 301 if { capture.req.uri
lang\= -m found }


Bye

---
Guillaume Bourque, B.Sc.,

Le 2015-11-12 à 03:59, Igor Cicimov 
a écrit :

On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque
 wrote:

Hi,

thanks for the suggestion but it did not work for me.   I tried

acl fr_top  url_reg/?lang=
acl fr_top  url_reg/?lang=$
# off acl fr_topurlp_reg(lang\=$,?)
-m found
# off acl fr_topurlp_reg(lang\=$,?)
-m found

but with no luck

thanks

---
Guillaume Bourque, B.Sc.,

Le 2015-11-12 à 02:18, Igor Cicimov 
a écrit :

On 12/11/2015 5:30 PM, "Guillaume Bourque"
 wrote:


Hello Bryan

I’m running haproxy 1.5.4 and I can’t find any example on how to

user req.uri if you could give a examples on how to match a specific
query to redirect to another


From http://domain/pages/store.php?lang=fr   to http://domain/store/

That would be great !

TIA



---
Guillaume Bourque, B.Sc.,

Le 2015-11-12 à 00:42, Bryan Talbot  a

écrit :



On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque

 wrote:


Hi all,

I can’t create an acl that will match this

http://domain/?lang=

I tried

acl fr_top  path_reg^/.lang\=$
acl fr_top  path_reg

^/\?lang\=$


acl fr_toppath_beg

/?lang\=$






You can't match the query string with the 'path' matcher. Try

'req.uri' or 'query' if you're using 1.6.






Try this:

acl fr_top  url_reg   /pages/store.php?lang=fr


Ok, my last try :-)

http-request redirect location /store code 301 if { capture.req.uri
lang= -m found }




Re: acl regex

2015-11-12 Thread Igor Cicimov
On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque <
guillaume.bour...@logisoftech.com> wrote:

> Hi,
>
> thanks for the suggestion but it did not work for me.   I tried
>
>acl fr_top  url_reg/?lang=
>acl fr_top  url_reg/?lang=$
> # off acl fr_topurlp_reg(lang\=$,?) -m
> found
> # off acl fr_topurlp_reg(lang\=$,?) -m
> found
>
> but with no luck
>
> thanks
>
> ---
> Guillaume Bourque, B.Sc.,
> Le 2015-11-12 à 02:18, Igor Cicimov  a
> écrit :
>
>
> On 12/11/2015 5:30 PM, "Guillaume Bourque" <
> guillaume.bour...@logisoftech.com> wrote:
> >
> > Hello Bryan
> >
> > I’m running haproxy 1.5.4 and I can’t find any example on how to user
> req.uri if you could give a examples on how to match a specific query to
> redirect to another
> >
> > From http://domain/pages/store.php?lang=fr   to http://domain/store/
> >
> > That would be great !
> >
> > TIA
> >
> >
> >
> > ---
> > Guillaume Bourque, B.Sc.,
> >
> > Le 2015-11-12 à 00:42, Bryan Talbot  a écrit :
> >
> >> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque <
> guillaume.bour...@logisoftech.com> wrote:
> >>>
> >>> Hi all,
> >>>
> >>> I can’t create an acl that will match this
> >>>
> >>> http://domain/?lang=
> >>>
> >>> I tried
> >>>
> >>> acl fr_top  path_reg^/.lang\=$
> >>> acl fr_top  path_reg^/\?lang\=$
> >>>
> >>> acl fr_toppath_beg/?lang\=$
> >>>
> >>>
> >>
> >>
> >> You can't match the query string with the 'path' matcher. Try 'req.uri'
> or 'query' if you're using 1.6.
> >>
> >>
> >
> Try this:
>
> acl fr_top  url_reg   /pages/store.php?lang=fr
>
>
>
Ok, my last try :-)

http-request redirect location /store code 301 if { capture.req.uri lang=
-m found }


Re: acl regex

2015-11-12 Thread Guillaume Bourque
Hello Igor,

thanks a lot still not working 

would I need to escape the = 

> http-request redirect location /store code 301 if { capture.req.uri lang\= -m 
> found }


Bye

---
Guillaume Bourque, B.Sc.,
Le 2015-11-12 à 03:59, Igor Cicimov  a écrit :

> 
> 
> On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque 
>  wrote:
> Hi,
> 
> thanks for the suggestion but it did not work for me.   I tried
> 
>acl fr_top  url_reg/?lang=
>acl fr_top  url_reg/?lang=$
> # off acl fr_topurlp_reg(lang\=$,?) -m 
> found
> # off acl fr_topurlp_reg(lang\=$,?) -m 
> found
> 
> but with no luck
> 
> thanks
> 
> ---
> Guillaume Bourque, B.Sc.,
> Le 2015-11-12 à 02:18, Igor Cicimov  a écrit :
> 
>> 
>> On 12/11/2015 5:30 PM, "Guillaume Bourque" 
>>  wrote:
>> >
>> > Hello Bryan
>> >
>> > I’m running haproxy 1.5.4 and I can’t find any example on how to user 
>> > req.uri if you could give a examples on how to match a specific query to 
>> > redirect to another 
>> >
>> > From http://domain/pages/store.php?lang=fr   to http://domain/store/
>> >
>> > That would be great !
>> >
>> > TIA
>> >
>> >
>> >
>> > ---
>> > Guillaume Bourque, B.Sc.,
>> >
>> > Le 2015-11-12 à 00:42, Bryan Talbot  a écrit :
>> >
>> >> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque 
>> >>  wrote:
>> >>>
>> >>> Hi all,
>> >>>
>> >>> I can’t create an acl that will match this
>> >>>
>> >>> http://domain/?lang=
>> >>>
>> >>> I tried
>> >>>
>> >>> acl fr_top  path_reg^/.lang\=$
>> >>> acl fr_top  path_reg^/\?lang\=$
>> >>>
>> >>> acl fr_toppath_beg/?lang\=$
>> >>>
>> >>>
>> >>
>> >>
>> >> You can't match the query string with the 'path' matcher. Try 'req.uri' 
>> >> or 'query' if you're using 1.6. 
>> >>
>> >>
>> >
>> Try this:
>> 
>> acl fr_top  url_reg   /pages/store.php?lang=fr
>> 
> 
> 
> Ok, my last try :-)
> 
> http-request redirect location /store code 301 if { capture.req.uri lang= -m 
> found }
> 
> 
> 



acl regex

2015-11-11 Thread Guillaume Bourque
Hi all,

I can’t create an acl that will match this

http://domain/?lang=

I tried

acl fr_top  path_reg^/.lang\=$
acl fr_top  path_reg^/\?lang\=$

acl fr_toppath_beg/?lang\=$

I have a redirect 301 with 

http-request redirect location http://doamine.com/ code 301 if fr_top


I have done other redirect that works fine but no luck with this one

Any help greatly appreciated.

Thanks



---
Guillaume Bourque, B.Sc.,


Re: acl regex

2015-11-11 Thread Bryan Talbot
On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque <
guillaume.bour...@logisoftech.com> wrote:

> Hi all,
>
> I can’t create an acl that will match this
>
> http://domain/?lang=
>
> I tried
>
> acl fr_top  path_reg^/.lang\=$
> acl fr_top  path_reg^/\?lang\=$
>
> acl fr_toppath_beg/?lang\=$
>
>
>

You can't match the query string with the 'path' matcher. Try 'req.uri' or
'query' if you're using 1.6.


Re: acl regex

2015-11-11 Thread Guillaume Bourque
Hi,

thanks for the suggestion but it did not work for me.   I tried

   acl fr_top  url_reg/?lang=
   acl fr_top  url_reg/?lang=$
# off acl fr_topurlp_reg(lang\=$,?) -m found
# off acl fr_topurlp_reg(lang\=$,?) -m found

but with no luck

thanks

---
Guillaume Bourque, B.Sc.,
Le 2015-11-12 à 02:18, Igor Cicimov  a écrit :

> 
> On 12/11/2015 5:30 PM, "Guillaume Bourque" 
>  wrote:
> >
> > Hello Bryan
> >
> > I’m running haproxy 1.5.4 and I can’t find any example on how to user 
> > req.uri if you could give a examples on how to match a specific query to 
> > redirect to another 
> >
> > From http://domain/pages/store.php?lang=fr   to http://domain/store/
> >
> > That would be great !
> >
> > TIA
> >
> >
> >
> > ---
> > Guillaume Bourque, B.Sc.,
> >
> > Le 2015-11-12 à 00:42, Bryan Talbot  a écrit :
> >
> >> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque 
> >>  wrote:
> >>>
> >>> Hi all,
> >>>
> >>> I can’t create an acl that will match this
> >>>
> >>> http://domain/?lang=
> >>>
> >>> I tried
> >>>
> >>> acl fr_top  path_reg^/.lang\=$
> >>> acl fr_top  path_reg^/\?lang\=$
> >>>
> >>> acl fr_toppath_beg/?lang\=$
> >>>
> >>>
> >>
> >>
> >> You can't match the query string with the 'path' matcher. Try 'req.uri' or 
> >> 'query' if you're using 1.6. 
> >>
> >>
> >
> Try this:
> 
> acl fr_top  url_reg   /pages/store.php?lang=fr
> 



Re: acl regex

2015-11-11 Thread Guillaume Bourque
Hello Bryan

I’m running haproxy 1.5.4 and I can’t find any example on how to user req.uri 
if you could give a examples on how to match a specific query to redirect to 
another 

From http://domain/pages/store.php?lang=fr   to http://domain/store/

That would be great !

TIA



---
Guillaume Bourque, B.Sc.,

Le 2015-11-12 à 00:42, Bryan Talbot  a écrit :

> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque 
>  wrote:
> Hi all,
> 
> I can’t create an acl that will match this
> 
> http://domain/?lang=
> 
> I tried
> 
> acl fr_top  path_reg^/.lang\=$
> acl fr_top  path_reg^/\?lang\=$
> 
> acl fr_toppath_beg/?lang\=$
> 
> 
> 
> 
> You can't match the query string with the 'path' matcher. Try 'req.uri' or 
> 'query' if you're using 1.6. 
> 
> 



Re: acl regex

2015-11-11 Thread Igor Cicimov
On 12/11/2015 5:30 PM, "Guillaume Bourque" <
guillaume.bour...@logisoftech.com> wrote:
>
> Hello Bryan
>
> I’m running haproxy 1.5.4 and I can’t find any example on how to user
req.uri if you could give a examples on how to match a specific query to
redirect to another
>
> From http://domain/pages/store.php?lang=fr   to http://domain/store/
>
> That would be great !
>
> TIA
>
>
>
> ---
> Guillaume Bourque, B.Sc.,
>
> Le 2015-11-12 à 00:42, Bryan Talbot  a écrit :
>
>> On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque <
guillaume.bour...@logisoftech.com> wrote:
>>>
>>> Hi all,
>>>
>>> I can’t create an acl that will match this
>>>
>>> http://domain/?lang=
>>>
>>> I tried
>>>
>>> acl fr_top  path_reg^/.lang\=$
>>> acl fr_top  path_reg^/\?lang\=$
>>>
>>> acl fr_toppath_beg/?lang\=$
>>>
>>>
>>
>>
>> You can't match the query string with the 'path' matcher. Try 'req.uri'
or 'query' if you're using 1.6.
>>
>>
>
Try this:

acl fr_top  url_reg   /pages/store.php?lang=fr