deliverance: how to use regex in path?

3 messages Options
Embed this post
Permalink
Mirto Silvio Busico-2 () deliverance: how to use regex in path?
Reply Threaded More More options
Print post
Permalink
Hi all,
I'm trying to use two plone sites behind deliverance.

I'm using regex in the path of the proxy directive, but it doesn't work
as I expect. So I suppose that I'm using it in the wrong mode.

The plone sites live in "http://locahost:4180/base3" and
"http://locahost:4180/intonso"

The deliverance (serving on port 4170) proxy statements are:

  <proxy path="regex:^/base3" class="plone-msb-base">
    <dest
href="http://localhost:4180/VirtualHostBase/http/{Host}/VirtualHostRoot/base3/"
/>
  </proxy>

  <proxy path="regex:^/intonso" class="plone-msbtema1" rewrite-links="1">
    <dest
href="http://localhost:4180/VirtualHostBase/http/{Host}/VirtualHostRoot/intonso/"
/>
  </proxy>

And these are the results for the various links:

http://localhost:4170/base3/               works correctly
http://localhost:4170/base3/intonso    ERROR goes to
"http://locahost:4180/intonso" with base3 class: I expected a 404 page
not found
http://localhost:4170/intonso/            works correctly
http://localhost:4170/intonso/base3   ERROR goes to
"http://locahost:4180/base3" with intonso class: I expected a 404 page
not found

In my mind "regex:^/base3" should mean: "a path that starts with /base3"
so "/base3/something" matches and "someting/base3" doesn't match.
If it is so, "/base3/intonso" should match the first rule and should be
proxied to  "http://locahost:4180/base3" that doesn' have an "intonso" page.

What I'm doing wrong?

Thanks
    Mirto




[mirtosilvio_busico.vcf]

begin:vcard
fn:Mirto Silvio Busico
n:Busico;Mirto Silvio
org:Busico Mirto Silvio
adr:;;Via Casiglion De' Pepoli 84;Roma;RM;00127;Italia
email;internet:[hidden email]
title:Dr.
tel;work:+39 333 4562651
tel;cell:+39 333 4562651
x-mozilla-html:TRUE
version:2.1
end:vcard



_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
Nathan Van Gheem () Re: deliverance: how to use regex in path?
Reply Threaded More More options
Print post
Permalink
Hi Mirto,

First off, there is a deliverance list where this email would be better served. 

I think your regex is fine.  If fact, I think you could get away will just doing '<proxy path="/base3" ....'.   I think your problem comes from the way you set up the virtual host monster url.  IIRC, if should be like this,
 <proxy path="regex:^/base3" class="plone-msb-base">
  <dest href="http://localhost:4180/VirtualHostBase/http/{Host}/base3/VirtualHostRoot/" />
 </proxy>


Good luck,
Nathan Van Gheem

On Wed, Sep 30, 2009 at 11:06 AM, Mirto Silvio Busico <[hidden email]> wrote:
Hi all,
I'm trying to use two plone sites behind deliverance.

I'm using regex in the path of the proxy directive, but it doesn't work as I expect. So I suppose that I'm using it in the wrong mode.

The plone sites live in "http://locahost:4180/base3" and "http://locahost:4180/intonso"

The deliverance (serving on port 4170) proxy statements are:

 <proxy path="regex:^/base3" class="plone-msb-base">
  <dest href="http://localhost:4180/VirtualHostBase/http/{Host}/VirtualHostRoot/base3/" />
 </proxy>

 <proxy path="regex:^/intonso" class="plone-msbtema1" rewrite-links="1">
  <dest href="http://localhost:4180/VirtualHostBase/http/{Host}/VirtualHostRoot/intonso/" />
 </proxy>

And these are the results for the various links:

http://localhost:4170/base3/               works correctly
http://localhost:4170/base3/intonso    ERROR goes to "http://locahost:4180/intonso" with base3 class: I expected a 404 page not found
http://localhost:4170/intonso/            works correctly
http://localhost:4170/intonso/base3   ERROR goes to "http://locahost:4180/base3" with intonso class: I expected a 404 page not found

In my mind "regex:^/base3" should mean: "a path that starts with /base3" so "/base3/something" matches and "someting/base3" doesn't match.
If it is so, "/base3/intonso" should match the first rule and should be proxied to  "http://locahost:4180/base3" that doesn' have an "intonso" page.

What I'm doing wrong?

Thanks
  Mirto




_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers



_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
Mirto Silvio Busico-2 () Re: deliverance: how to use regex in path?
Reply Threaded More More options
Print post
Permalink
Thanks Nathan,
it seems that deliverance works as expected and I have problems in VHM.

Mirto

Nathan Van Gheem ha scritto:

> Hi Mirto,
>
> First off, there is a deliverance list where this email would be
> better served.
>
> I think your regex is fine.  If fact, I think you could get away will
> just doing '<proxy path="/base3" ....'.   I think your problem comes
> from the way you set up the virtual host monster url.  IIRC, if should
> be like this,
>  <proxy path="regex:^/base3" class="plone-msb-base">
>   <dest
> href="http://localhost:4180/VirtualHostBase/http/{Host}/base3/VirtualHostRoot/
> <http://localhost:4180/VirtualHostBase/http/%7BHost%7D/VirtualHostRoot/base3/>"
> />
>  </proxy>
>
>
> Good luck,
> Nathan Van Gheem
>
> On Wed, Sep 30, 2009 at 11:06 AM, Mirto Silvio Busico
> <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi all,
>     I'm trying to use two plone sites behind deliverance.
>
>     I'm using regex in the path of the proxy directive, but it doesn't
>     work as I expect. So I suppose that I'm using it in the wrong mode.
>
>     The plone sites live in "http://locahost:4180/base3" and
>     "http://locahost:4180/intonso"
>
>     The deliverance (serving on port 4170) proxy statements are:
>
>      <proxy path="regex:^/base3" class="plone-msb-base">
>       <dest
>     href="http://localhost:4180/VirtualHostBase/http/{Host}/VirtualHostRoot/base3/
>     <http://localhost:4180/VirtualHostBase/http/%7BHost%7D/VirtualHostRoot/base3/>"
>     />
>      </proxy>
>
>      <proxy path="regex:^/intonso" class="plone-msbtema1"
>     rewrite-links="1">
>       <dest
>     href="http://localhost:4180/VirtualHostBase/http/{Host}/VirtualHostRoot/intonso/
>     <http://localhost:4180/VirtualHostBase/http/%7BHost%7D/VirtualHostRoot/intonso/>"
>     />
>      </proxy>
>
>     And these are the results for the various links:
>
>     http://localhost:4170/base3/               works correctly
>     http://localhost:4170/base3/intonso    ERROR goes to
>     "http://locahost:4180/intonso" with base3 class: I expected a 404
>     page not found
>     http://localhost:4170/intonso/            works correctly
>     http://localhost:4170/intonso/base3   ERROR goes to
>     "http://locahost:4180/base3" with intonso class: I expected a 404
>     page not found
>
>     In my mind "regex:^/base3" should mean: "a path that starts with
>     /base3" so "/base3/something" matches and "someting/base3" doesn't
>     match.
>     If it is so, "/base3/intonso" should match the first rule and
>     should be proxied to  "http://locahost:4180/base3" that doesn'
>     have an "intonso" page.
>
>     What I'm doing wrong?
>
>     Thanks
>       Mirto
>
>
>
>
>     _______________________________________________
>     Product-Developers mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     http://lists.plone.org/mailman/listinfo/product-developers
>
>

[mirtosilvio_busico.vcf]

begin:vcard
fn:Mirto Silvio Busico
n:Busico;Mirto Silvio
org:Busico Mirto Silvio
adr:;;Via Casiglion De' Pepoli 84;Roma;RM;00127;Italia
email;internet:[hidden email]
title:Dr.
tel;work:+39 333 4562651
tel;cell:+39 333 4562651
x-mozilla-html:TRUE
version:2.1
end:vcard



_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers