Skip to content

Instantly share code, notes, and snippets.

@natematias
Created January 28, 2013 22:03
Show Gist options
  • Select an option

  • Save natematias/4659583 to your computer and use it in GitHub Desktop.

Select an option

Save natematias/4659583 to your computer and use it in GitHub Desktop.
What I added to my OSX /etc/apache2/httpd.conf to proxy CouchDB through Apache and overcome the cross-site scripting problem when developing my own couch apps.
## just for context, here's the Directory entry from /etc/apache2/httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
# Turn on mod_rewrite
RewriteEngine On
RewriteOptions Inherit
# Send all GET and HEAD requests to CouchDB
RewriteCond %{REQUEST_METHOD} GET|HEAD
RewriteRule /db/(.*) http://localhost:5984/$1 [P]
# Correct all outgoing Location headers
ProxyPassReverse /db/ http://localhost:5984/
ProxyRequests Off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment