Created
April 12, 2020 13:26
-
-
Save leandromoreira/5bc08d518b5d1cac8fb29e74f3334015 to your computer and use it in GitHub Desktop.
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
-- counting how many requests a given ip did | |
local redis_client = redis_cluster:new(config) | |
local resp, err = redis_client:incr(ngx.var.remote_addr) | |
ngx.header['X-Request-Counter'] = resp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment