/ Zope / Apsis / Pound Mailing List / Archive / 2007 / 2007-09 / Redirecting based on URL

[ << ] [ >> ]

[ Taking advantage of Pound for logging / ... ] [ Pound ratio question: load balancer to server ... ]

Redirecting based on URL
Pete DeLaurentis <pete(at)nextengine.com>
2007-09-19 07:58:26 [ FULL ]
Hi guys,

Does anyone know how to route based on subdomain specified in the URL?

I have two subdomains pointing to one server running pound as a load  
balancer (155.132.55.32).  The load balancer also functions as a  
development test server box.

Here's the desired mapping:

monkey.nextengine.com   => 155.132.55.32
elephant.nextengine.com  => 155.132.55.34, 155.132.55.35

Note: names + IP addresses have been fictionalized, and no animals  
were harmed in the making of this example

Any advice is much appreciated.

Thanks,
Pete DeLaurentis
NextEngine, Inc.

Re: [Pound Mailing List] Redirecting based on URL
"Mister V" <badvad(at)gmail.com>
2007-09-19 10:44:04 [ FULL ]
Service
 Url         "monkey.nextengine.com.*"

 BackEnd
    Address  155.132.55.32
     Port  ????
 End
End

Service
 Url         "elephant.nextengine.com.* <http://elephant.nextengine.com/>
"
   BackEnd
     Address  155.132.55.35
     Port  8081
   End

End

#anything else will goto ?
Service
  BackEnd
    Address  127.0.0.1
    Port  8081
  End
End



On 19/09/2007, Pete DeLaurentis <pete(at)nextengine.com> wrote:[...]
Attachments:  
text.html text/html 2606 Bytes

Re: [Pound Mailing List] Redirecting based on URL
Dave Steinberg <dave(at)redterror.net>
2007-09-19 13:35:55 [ FULL ]
> Does anyone know how to route based on subdomain specified in the
URL?[...]

Follow the example labeled 'VIRTUAL HOSTS (IN GENERAL)' on the pound 
homepage:

http://www.apsis.ch/pound

That's how I do it for a number of sites.  Despite being not 
recommended, it works great!

PS - Anyone know why it isn't recommended?

Regards,[...]

Re: [Pound Mailing List] Redirecting based on URL
Alex Hunsley <alex.hunsley(at)blueyonder.co.uk>
2007-09-19 14:08:37 [ FULL ]
Dave Steinberg wrote:[...][...]
The author of the pound page gives two reasons - go back and read more 
carefully the part about vhosts!
Alex

[...]

Re: [Pound Mailing List] Redirecting based on URL
Pete DeLaurentis <pete(at)nextengine.com>
2007-09-19 21:23:09 [ FULL ]
Thanks for the help guys.

I had a question if there was any difference between the virtual  
hosting method, where you use:

HeadRequire "Host: .*monkey.nextengine.com.*"

Or the URL method mentioned by Mister V:

Url         "monkey.nextengine.com.*"

In my limited understanding the chief disadvantage of virtual hosts  
is that they don't work through SSL.  Are both of these methods  
"virtual hosting"?

Thanks,
Pete

[...]
>>> Does anyone know how to route based on subdomain specified in the 

>>> URL?
>>>
>>> I have two subdomains pointing to one server running pound as a  
>>> load balancer (155.132.55.32).  The load balancer also functions  
>>> as a development test server box.
>>>
>>> Here's the desired mapping:
>>>
>>> monkey.nextengine.com   => 155.132.55.32
>>> elephant.nextengine.com  => 155.132.55.34,
155.132.55.35[...][...][...][...]

Re: [Pound Mailing List] Redirecting based on URL
Dave Steinberg <dave(at)redterror.net>
2007-09-19 22:08:08 [ FULL ]
Pete DeLaurentis wrote:[...]

I personally use the former method.  From my understanding, 'URL' 
matches the request URL (i.e. the requested path), so it would not work 
in this case.

Regarding SSL, name-based virtual hosting is impossible with SSL. 
That's what these techniques are.  This is a limitation of the HTTPS 
protocol, not with pound or any software.  You must use a specific IP 
for each distinct certificate you wish to serve.

Regards,[...]

Re: [Pound Mailing List] Redirecting based on URL
"Mister V" <badvad(at)gmail.com>
2007-09-19 22:14:50 [ FULL ]
I dont know much about HeadRequire but I presume it is very strict and
redirects according to the host header ...

As far as URL I think its more flexible and can be used generically i.e.


Service
 Url         ".*/cgi-bin/script.cgi(%4.*|%5.*|\[.*|\]|%3.*|%2.*|%0.*)"
 BackEnd
    Address  127.0.0.1
     Port  81
 End
End

This means
http://domain1.com/cgi-bin/script.cgi.Any
thing else with funny chars like
those accept
http://domain2.com/cgi-bin/script.cgi.Any
thing else with funny chars like
those accept

etc etc
I can keep adding urls or even more specific urls dedicated to a domain and
funny chars or ,* which is all and send it to a backend....

Then to wrap it all up a thing to catch any dodgy chars for urls that you
know wont require any funny chars which is the rest of the site

Service
 Url        
".*.(%.*|\[|\]|`|;|\|(at)|\||~|<|>|\"|\$|\(|\)|\{|\}|\*|!|')"
 Redirect    "http://www.masterdomain.com/"
   BackEnd
     Address  127.0.0.1
     Port  81
   End

End

#and finally to send all good traffic to the right host

Service
  BackEnd
    Address  127.0.0.1
    Port  81
  End
End


And there you have it

In basic Url can be used for looking a pattern across multiple sites and
doing a redirect according to that..


I need to get a job at pound hehe dont worry am a nubee tooo at this but is
very cool

Peace to all the pounders

Keep pounding away





On 19/09/2007, Pete DeLaurentis <pete(at)nextengine.com> wrote:[...]
Attachments:  
text.html text/html 4941 Bytes

Re: [Pound Mailing List] Redirecting based on URL
Gergely CZUCZY <phoemix(at)harmless.hu>
2007-09-19 22:15:54 [ FULL ]
On Wed, Sep 19, 2007 at 04:08:08PM -0400, Dave Steinberg wrote:[...]
or use that trick, as you can create a *.domain.tld cert, that will
be good for all the .domain.tld subdomains for your webserver.

Sincerely,

Gergely Czuczy
mailto: gergely.czuczy(at)harmless.hu
[...]
Attachments:  
application.pgp-signature application/pgp-signature 1374 Bytes

MailBoxer