couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: new vhost manager
Date Mon, 16 Aug 2010 19:55:24 GMT
On Mon, Aug 16, 2010 at 5:06 PM, Benoit Chesneau <bchesneau@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

Mime
View raw message