You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2010/08/16 17:06:09 UTC

new vhost manager

So to solve the previous bug I mentionned, I've refactored the vhost
part. I put it in its own gen_server. It's now possible add
dynamically vhosts without restart by just adding them to the ini, It
allows wildcard in vhost, specific functions in erlang  per domain
(which allows someone to build its own route). Default redirect
function could aso be changed in the ini. It also fix issue in etap
test (160) .

more details here :

https://issues.apache.org/jira/browse/COUCHDB-855

- benoit

Re: new vhost manager

Posted by Filipe David Manana <fd...@apache.org>.
On Mon, Aug 16, 2010 at 8:55 PM, Benoit Chesneau <bc...@gmail.com>wrote:

>
>
> Works here, I can commit it if it's ok for you.
>

I have only quickly glanced at the patch, but I say +1.
Seems like a very useful feature.

thanks Benoît


>
> - benoit
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: new vhost manager

Posted by Benoit Chesneau <bc...@gmail.com>.
On Mon, Aug 16, 2010 at 5:06 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> So to solve the previous bug I mentionned, I've refactored the vhost
> part. I put it in its own gen_server. It's now possible add
> dynamically vhosts without restart by just adding them to the ini, It
> allows wildcard in vhost, specific functions in erlang  per domain
> (which allows someone to build its own route). Default redirect
> function could aso be changed in the ini. It also fix issue in etap
> test (160) .
>
> more details here :
>
> https://issues.apache.org/jira/browse/COUCHDB-855
>
> - benoit
>

updated version of the patch added with domain rewriting possibilities :

Like in the _rewrite handler you could match some variable and use
them to create the target path. Some examples:

    [vhosts]
    *.example.com = /*
    $dbname.example.com = /$dbname
    $ddocname.$dbname.example.com = /$dbname/_design/$ddocname/_rewrite

First rule pass wildcard as dbname, second do the same but use a
variable name and the third one allows you to use any app with
$ddocname in any db with $dbname .
[ Show » ]
Benoit Chesneau added a comment - 16/Aug/10 03:52 PM new version of
the patch allowing Host rewriting : Like in the _rewrite handler you
could match some variable and use them to create the target path. Some
examples:     [vhosts]     *.example.com = /*     $dbname.example.com
= /$dbname     $ddocname.$dbname.example.com =
/$dbname/_design/$ddocname/_rewrite First rule pass wildcard as
dbname, second do the same but use a variable name and the third one
allows you to use any app with $ddocname in any db with $dbname .


Works here, I can commit it if it's ok for you.

- benoit

Re: new vhost manager

Posted by Benoit Chesneau <bc...@gmail.com>.
On Mon, Aug 16, 2010 at 5:06 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> So to solve the previous bug I mentionned, I've refactored the vhost
> part. I put it in its own gen_server. It's now possible add
> dynamically vhosts without restart by just adding them to the ini, It
> allows wildcard in vhost, specific functions in erlang  per domain
> (which allows someone to build its own route). Default redirect
> function could aso be changed in the ini. It also fix issue in etap
> test (160) .
>
> more details here :
>
> https://issues.apache.org/jira/browse/COUCHDB-855
>
> - benoit
>

Please let me know if it's ok for you and I will commit it asap.

- benoit