Created
October 28, 2013 02:58
-
-
Save markselby/7190829 to your computer and use it in GitHub Desktop.
Nginx config for using LUA / Redis cache.
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
location / { | |
try_files $uri @redis_cache; | |
add_header Source Files; # Handy for development | |
} | |
location @redis_cache { | |
# Make sure this path is correct | |
# Run "nginx -V" from the command prompt and look for --prefix=/path/to/somewhere | |
# and place redis.lua there, or use an absolute path as shown below | |
content_by_lua_file /path/to/your/config/redis.lua; | |
error_page 404 503 = @writebox_upstream; | |
add_header Source Redis; # Handy for development | |
} | |
location @writebox_upstream { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Remote-IP $remote_addr; | |
add_header Source Upstream; # Handy for development | |
# ...... etc etc ........ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment