Guest User

Untitled

a guest
Jul 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. location /redis {
  2. internal;
  3.  
  4. redis2_query get $request_uri;
  5. set_unescape_uri $query $arg_query;
  6.  
  7. redis2_raw_query $query;
  8. redis2_pass 127.0.0.1:6379;
  9. }
  10.  
  11. location / {
  12. content_by_lua '
  13. local res = ngx.location.capture("/redis",
  14. { args = { query = "$request_uri\\r\\n" } }
  15. )
  16. local href = string.gsub(res.body, "\$[0-9]+\\r\\n", "");
  17. ngx.redirect(href);
  18. ';
  19. }
Add Comment
Please, Sign In to add comment