Skip to content

Instantly share code, notes, and snippets.

@wu-lee wu-lee/gist:9274194
Created Feb 28, 2014

Embed
What would you like to do?
Using Apache as s CORS-handling proxy to a CouchDB server
<IfModule !proxy_module>
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
</IfModule>
<IfModule !proxy_http_module>
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
</IfModule>
<IfModule !headers_module>
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
</IfModule>
ProxyRequests Off
<Location /inventory/>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} !=OPTIONS
RewriteRule /inventory/(.*) http://localhost:5984/inventory/$1 [P,L]
ProxyPassReverse http://localhost:5984/inventory/
Header set Access-Control-Allow-Origin "*"
#Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
#Header set Access-Control-Allow-Methods "GET, PUT, POST, OPTIONS, DELETE, HEAD, COPY"
Header set Access-Control-Max-Age 3600
</Location>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.