Created
February 28, 2014 16:31
-
-
Save wu-lee/9274194 to your computer and use it in GitHub Desktop.
Using Apache as s CORS-handling proxy to a CouchDB server
This file contains 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
<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