Created
January 28, 2013 22:03
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## 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