Created
November 26, 2015 15:20
-
-
Save witscher/1ed67e40472c87e8f711 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
# Request Limiter checking multiple values with small footprint | |
# if referer is not set | |
map $http_referer $limit_referer { | |
default ""; | |
"" "1"; | |
"-" "1"; | |
} | |
# if custom parameter is not set. i.e. you always expect urls like "/tracker?campaignid=1234" | |
map $arg_campaignid $limit_campaignid { | |
default ""; | |
"" "1"; | |
"-" "1"; | |
} | |
map "$limit_referer$limit_campaignid" $custom_limit { | |
default ""; | |
"11" 1; | |
} | |
limit_req_zone $custom_limit zone=custom:1m rate=1r/s; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment