I think (and correct me if I'm wrong) that Karen just wants to use the
virtual host as the user name for which to generate content, not to
actually have it be handled by a different action bean or webapp.

Why not just grab the 'Host' header from the request?  Browsers are
pretty good at conforming to HTTP/1.1 these days.

I don't think it really belongs in the UrlBinding, but it would be
pretty trivial to extend the dispatcher to set a property from the
Host, based on some annotation.  Actually, some generic way to declare
request headers to bind (and validate) would be kinda nice.

Cheers,
Dmitri

On Fri, Dec 25, 2009 at 6:46 AM, Oscar Westra van Holthe - Kind
<[email protected]> wrote:
> On 25-12-2009 at 10:52, KR wrote:
>> Currently the only way to implement sub domain URL's in Stripes seems to be
>> to use mod_rewrite to translate the incoming URL's. Problem with that
>> approach is that you loose the ability to let Stripes generate any links to
>> these actionbeans. Making you're coding more complex and error prone. It's
>> less elegant and less agile.
>
> You can indeed use mod_rewrite for that. But what I think you really want is
> a reverse proxy: the proxy acts as if it is the webapp host, but forwards the
> requests to the real server behind the scenes.
>
> So if the proxy server receives a request for
>        http://customer1.mydomain.com/...
> It forwards it to the application server as:
>        http://localhost:8080/customer1/...
>
> The proxy server must also rewrite any URL's in the response (also the HTML
> body) as were they generated for the proxy server.
>
> I use this virtual host setup for this:
>
>        NameVirtualHost *:80
>        <VirtualHost *:80>
>                ServerName customer1.mydomain.com
>                ProxyRequests off
>                ProxyPass http://localhost:8080/customer1
>                ProxyPassReverse http://localhost:8080/customer1
>                # Use these if the context root also changes (needs 
> mod_proxy_html)
>                SetOutputFilter proxy-html # For versions prior to 3.1
>                #ProxyHTMLEnable On # For version 3.1 and later
>                ProxyHTMLURLMap / /customer1/
>        </VirtualHost>
>
> You can find more information here:
>        http://www.apachetutor.org/admin/reverseproxies
>
>
> Oscar
>
> --
>   ,-_  Oscar Westra van Holthe - Kind      http://www.xs4all.nl/~kindop/
>  /() )
>  (__ (  A: Because people normally read from top to bottom.
> =/  ()  Q: Why is top-posting such a bad thing?
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to