Skip to content

Instantly share code, notes, and snippets.

@timhodson
Created February 20, 2012 16:01
Show Gist options
  • Save timhodson/1869847 to your computer and use it in GitHub Desktop.
Save timhodson/1869847 to your computer and use it in GitHub Desktop.
Create an apache proxy with Kasabi apikey header injection
# Create an apache proxy with Kasabi apikey header injection
# Requests to http://127.0.0.1/kasabi will be forwarded and have the X-KASABI-APIKEY header set.
# e.g.
# http://127.0.0.1/kasabi/dataset/food/apis/search?query=fish
# will be forwarded to
# http://api.kasabi.com/dataset/food/apis/search?query=fish
# and responses will be passed back to the client
NameVirtualHost *
<VirtualHost *>
ProxyRequests Off
<Proxy http://127.0.0.1/*>
Allow from all
</Proxy>
<LocationMatch "/kasabi">
ProxyPass http://api.kasabi.com/
ProxyPassReverse http://api.kasabi.com/
RequestHeader set X-KASABI-APIKEY "MySecretAPIKey"
</LocationMatch>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment