Created
January 3, 2011 23:55
-
-
Save fbettag/764201 to your computer and use it in GitHub Desktop.
nginx.conf redis
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
location /redis { | |
internal; | |
redis2_query get $request_uri; | |
set_unescape_uri $query $arg_query; | |
redis2_raw_query $query; | |
redis2_pass 127.0.0.1:6379; | |
} | |
location / { | |
content_by_lua ' | |
local res = ngx.location.capture("/redis", | |
{ args = { query = "$request_uri\\r\\n" } } | |
) | |
local href = string.gsub(res.body, "\$[0-9]+\\r\\n", ""); | |
ngx.redirect(href); | |
'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment