configuration files:

    reqrep ^([^\ ]*)\ /kaijiang([/\?\ ].*)    \1\ /result_aaa\
    reqirep ^Host: Host:\ www.bbb.com

Logs:
srv_aaa_caipiaos_01 0/0/0/2/2 404 735 - - ---- 0/0/0/0/0 0/0 "GET /result_aaa/ 
HTTP/1.1" 

but i can access www.bbb.com/result_aaa/


----------------------------------------------------------
> From: cyril.bo...@free.fr
> To: y...@hotmail.com
> CC: haproxy@formilux.org; w...@1wt.eu
> Subject: Re: Need help about reqrep (urgent)
> Date: Sat, 24 Sep 2011 16:32:05 +0200
> 
> Le Samedi 24 Septembre 2011 14:10:19 DerekLiao a écrit :
> > All,
> >     I tried what you suggested, I think it s also a problem on rewrite URI:
> > configuration files:
> >     reqrep ^([^\ ]*)\ /kaijiang(/.*)     \1\ /result_bbb\2
> >     reqirep ^Host: Host:\ www.bbb.com
> >     #reqdeny ^([^\ ]*)\ /kaijiang
> >     reqdeny ^([^\ ]*)\ /result_bbb
> >     option httpchk  GET / HTTP/1.1\r\nHost:\ www.bbb.com
> >     server srv_aaa_caipiaos_1_01 www.bbb.com:80 check
> > 
> > The problem show up like :
> > srv_aaa_caipiaos_1_01 20993/0/0/0/20993 404 484 - - ---- 4/4/0/1/0 0/0 "GET
> > /kaijiang HTTP/1.1"
> 
> Ok, now your log shows that you don't have a / at the end of your request but 
> your regexp requires one.
> If you want it to work, you need to adapt the regexp depending on your needs.
> For example :
> reqrep ^([^\ ]*)\ /kaijiang([/\?\ ].*)     \1\ /result_bbb\2
> 
> This will allow requests like :
> /kaijiang
> /kaijiang/...
> /kaijiang?param=value...
> 
> but won't match things like :
> /kaijiangfoo
> /kaijiangbar
> /kaijiang;param=value
> 
> -- 
> Cyril Bonté
                                          

Reply via email to