Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 99272 invoked from network); 18 Feb 2010 23:31:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Feb 2010 23:31:18 -0000 Received: (qmail 75253 invoked by uid 500); 18 Feb 2010 23:31:17 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 75169 invoked by uid 500); 18 Feb 2010 23:31:17 -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 75159 invoked by uid 99); 18 Feb 2010 23:31:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2010 23:31:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 74.125.83.52 as permitted sender) Received: from [74.125.83.52] (HELO mail-gw0-f52.google.com) (74.125.83.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2010 23:31:07 +0000 Received: by gwb1 with SMTP id 1so46501gwb.11 for ; Thu, 18 Feb 2010 15:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=H6YMWHuBSxYo2M5ccylIu4mt2QqwJ4et6tLZWUYBKMI=; b=MTrHjZw1aeHFQcgn2PH7hjsHiwjS5kQj7qsmN+NkOZFLTky1P/E5XWAVlF5lw2/viH nT0O3JKu4KfUMc3/KARVnM4haiwDCl1E6LxmIh4l4Puo0QkdnUuIzV3d4ra8+zE2/8eI c8fiYj/GpMjRY+O0P9iszl+s4349gwzsgAX7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=Kdt2MuRd0nY4jdWtYbEccFj+0+Jvdpd/5wICCg3AruIp0vFPEe+lr3yVJnvuMiNpBk h8LRGaPtoa+uQhlZOUWihRBxaRL+VFVql3GaoCLiEGbKnKaof0gXiDyXwtK+E9M5XKU3 k4ASL0vCDP4/4jRKm1+A22ZeeB35PnHLCPTFE= Received: by 10.150.16.4 with SMTP id 4mr518377ybp.110.1266535846419; Thu, 18 Feb 2010 15:30:46 -0800 (PST) Received: from ?10.0.0.102? ([216.189.160.250]) by mx.google.com with ESMTPS id 5sm625578ywd.44.2010.02.18.15.30.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Feb 2010 15:30:44 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Virtual Hosts From: J Chris Anderson In-Reply-To: <9D2F6BE1-DD90-4702-9196-ED6FBE8B6246@apache.org> Date: Thu, 18 Feb 2010 18:30:42 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <1A230BF8-1C82-4C4E-8B21-9145FB8AABB9@gmail.com> References: <9D2F6BE1-DD90-4702-9196-ED6FBE8B6246@apache.org> To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.1077) On Feb 18, 2010, at 6:23 PM, Jan Lehnardt wrote: > Hi dev@, >=20 > I added virtual host handling to CouchDB. I have a Github branch for = you to check out: >=20 > http://github.com/janl/couchdb/commits/vhosts >=20 > Alternatively, here's a full diff including etap tests:=20 >=20 > http://www.friendpaste.com/6B5dQU1fb27boOvxhm2nhf >=20 > =46rom local.ini: >=20 > ; To enable Virtual Hosts in CouchDB, add a vhost =3D path directive. = All requests to > ; the Virual Host will be redirected to the path. In the example below = all requests > ; to http://example.com/ are redirected to /database. > ; If you run CouchDB on a specific port, include the port number in = the vhost: > ; example.com:5984 =3D /database >=20 > [vhosts] > ;example.com =3D /database/ >=20 > In combination with Benoit's rewriter, this allows you to create = virtual hosts with=20 > really pretty URLs.=20 >=20 > The CouchDB default behaviour isn't changed. CouchDB simply inspects a > request's `Host:` header and maps it against any defined virtual = hosts. If a > match is found, CouchDB will make an internal redirect much like the = rewriter. >=20 > I did a stupid A/B test with Apache Bench and couldn't see any = performance > degradation. Feel free to prove me wrong :) >=20 > I'd like to commit this to trunk and also backport to 0.11. What do = you think? >=20 This code looks really good and simple. Way to go. +1 on including it in 0.11 as there's really nothing to this (especially = for people who don't enable it). > Thanks for you feedback. >=20 > Cheers > Jan > -- >=20