Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 12147 invoked from network); 16 Aug 2010 19:55:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Aug 2010 19:55:53 -0000 Received: (qmail 61260 invoked by uid 500); 16 Aug 2010 19:55:52 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 61215 invoked by uid 500); 16 Aug 2010 19:55:52 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 61207 invoked by uid 99); 16 Aug 2010 19:55:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Aug 2010 19:55:52 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bchesneau@gmail.com designates 209.85.160.180 as permitted sender) Received: from [209.85.160.180] (HELO mail-gy0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Aug 2010 19:55:46 +0000 Received: by gye5 with SMTP id 5so3097544gye.11 for ; Mon, 16 Aug 2010 12:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=I8sDVBs62MbyQ8D2XnXUYBY2Or80BWbcL3A8gC1Qyps=; b=IByHIvpGjFwmP/irCLavW7dhem5jfwfxdOVWFM/9triC3/PtRe0Wc8Kno5dd4cgOLo HiNp+xidqn3IvR0hCENGRKvflczOJcGeDwh5eAokJHwBd/keeYW/ofwf0LizKuuWBDxf bXXC4kbGD2yEIff3K2GK9fk1yw8CVYXJ23vkE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qRF5liOZJYEWvS/marW5bcMqmYJZ5GqSK9Qpsc3pqtP7Qe7dg5APJSG4PWSDj/ENUS U0odxO1g/yvs6GL134xAPWL6J8efoX/Nlp5X0lK8MNQx01NFuVFGCw8Frx9nTr9W6ZzJ s2FT2lnC6UW8Dh1+rZ+a5HQ4ACVYSB59oU0aA= MIME-Version: 1.0 Received: by 10.151.133.10 with SMTP id k10mr3833871ybn.260.1281988525238; Mon, 16 Aug 2010 12:55:25 -0700 (PDT) Received: by 10.231.169.18 with HTTP; Mon, 16 Aug 2010 12:55:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Aug 2010 21:55:24 +0200 Message-ID: Subject: Re: new vhost manager From: Benoit Chesneau To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Aug 16, 2010 at 5:06 PM, Benoit Chesneau wrot= e: > 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 =A0per 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 =3D /* $dbname.example.com =3D /$dbname $ddocname.$dbname.example.com =3D /$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 =BB ] 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 =3D /* $dbname.example.com =3D /$dbname $ddocname.$dbname.example.com =3D /$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