incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Geurts <>
Subject Re: reverse proxy discouraged?
Date Fri, 20 Aug 2010 08:09:23 GMT
A possible solution might be as simple as this:

create a virtualhost in apache2 that points to a particular documentRoot:

file: /etc/apache2/sites-available/
<VirtualHost *:80>

	DirectoryIndex index.html
        DocumentRoot /var/www/
	#Options FollowSymLinks
	#AllowOverride None

sudo a2ensite
sudo /etc/init.d/apache2 reload (or the equivalent for your system)

then, in /var/www/

create a file called '.htaccess'
with the following content:

<Files .htaccess>
order allow,deny
deny from all

<IfModule mod_rewrite.c>

RewriteEngine on

#the get options
RewriteRule ^db-name(.*)$ http://localhost:5984/db-name$1 [P]


'curl' will load the document residing at: /var/www/
'curl' will load the document residing at: http://localhost:5984/db-name
(i.e. access the couchdb database)

make sure you have mod_proxy and mod_rewrite enabled!

hope this helps,


On 20 aug 2010, at 08:07, Randall Leeds wrote:

> Ahh. I understand your problem.
> Your html cannot reference :5984, for cross-domain rules (as you
> noted), but instead the path you've forwarded to Couch.
> I'm not an apache wizard. I won't even pretend to try to tell you how.
> But if the example on the wiki and the apache docs is not enough,
> hopefully someone can chime in here or maybe you can find someone on
> IRC if you catch them at the right time.
> Asking in a more apache-specific forum might also yield some help.
> Even if they're not familiar with Couch I assume anyone with
> sufficient knowledge of the apache web server should be able to direct
> you to how to get X-domain between virtual hosts, if indeed it's
> virtual hosts that are the key.
> Good luck, Dan! And please, when you find out what you were missing
> please tell everyone here and update the wiki with any useful info. I
> have a feeling you're not the first nor the last person to try to set
> this up.
> Cheers,
> Randall

View raw message