Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- ';
- }
Add Comment
Please, Sign In to add comment