Last active
April 6, 2019 07:40
-
-
Save roktas/d0933086ca108a0b66a5b33d3e66cdcd 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
http { | |
# Each unique IP address will be limited to 10 requests per second. | |
# They cannot make a request for that URL within 100 milliseconds of its previous one. | |
limit_req_zone $binary_remote_addr zone=limit_req:10m rate=10r/s; | |
# Limit a single IP address to make no more than 100 connections within 1 minute. | |
limit_conn_zone $binary_remote_addr zone=limit_conn:1m; | |
limit_conn limit_conn 100; | |
server { | |
location /login/ { # FIXME | |
# Any request that arrives sooner than 100 milliseconds after the previous | |
# one is put in a queue with a size of 20. | |
limit_req zone=limit_req burst=20 nodelay; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment