Created
May 9, 2012 03:35
-
-
Save psobot/2641616 to your computer and use it in GitHub Desktop.
API proxying with nginx
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
proxy_cache_path /tmp/recipe_cache levels=1:2 keys_zone=RECIPE:64m inactive=3600m max_size=360m; | |
# Yada yada yada... | |
server { | |
# Yada yada yada, more in here... | |
location ^~ /recipes { | |
rewrite ^/recipes\??(.*) /recipes?key={your_private_api_key_here}&$1 break; | |
proxy_pass http://api.punchfork.com/; | |
proxy_cache RECIPE; | |
proxy_cache_valid 200 204 302 3600m; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment