Hi,

On Fri, Sep 23, 2011 at 11:20:52AM +0000, DerekLiao wrote:
> Hey there,
> 
>   I
> have trouble with direct ??reqrep?? 
> 
>  what I want is :
> 
> My main web site is : caipiao.aaa.com
> 
> 
> My second web site is: www.bbb.com
> 
> My goal is redirect URL from caipiao.aaa.com/ kaijiang
> ------------->www.bbb.com/result_aaa , but the URL in the browse still need
> to display caipiao.aaa.com/kaijiang
> 
> what I did is:
> 
> Frontend: 
> 
>  
> 
> acl acl_dom_caipiao.aaa.com                     hdr_dom(host) caipiao.aaa.com
> 
> acl acl_url_kaijiang path_beg 
> -i                  /kaijiang
> 
> use_backend cs_aaa_caipiaos_1                   if acl_dom_caipiao.aaa.com 
> acl_url_kaijiang
> 
>  
> 
> backend:
> 
> backend cs_aaa_caipiaos_1
> 
>     reqrep
> ^([^\ ]*)\ /kaijiang(/.*)     \1\ /result_aaa\2
> 
>     option httpchk  GET / HTTP/1.1\r\nHost:\ www.bbb.com
> 
>     server srv_aaa_caipiaos_1_01 www.bbb.com:80 check
> 

Are you sure that your server does not also consider the Host
header and refuses to serve /result_aaa from caipiao.aaa.com ?

> when I access caipiao.aaa.com/kaijiang,  I get a 404 error, looks like reqrep 
> did not
> working~
> 
> but if make a little change as below: 
> 
> acl acl_url_result path_beg 
> -i                    /result_aaa
> 
> use_backend cs_aaa_caipiaos_1                   if acl_dom_caipiao.aaa.com 
> acl_url_result
> 
> then I can access  caipiao.aaa.com/result_aaa directly,  So there should be a 
> problem on reqrep

Strange then.

> Could you help to analyze the root cause of this ?

What does your server say in its logs ? You'll have the useful information
there since you'll know how the request will have been rewritten.

Regards,
Willy


Reply via email to