Skip to content

Commit

Permalink
Update nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Oct 15, 2024
1 parent 456e759 commit 87c1b3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions __config/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Limit the request rate to 10 requests per second per IP address to prevent DDoS attack
# Limit the request rate to 50 requests per second per IP address to prevent DDoS attack
#
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=50r/s;

#
# Set a response status code that is returned to rejected requests
Expand All @@ -21,6 +21,9 @@ server
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

# Enable rate limiting to prevent Brute force attacks, DoS and DDoS attacks, and Web scraping
limit_req zone=mylimit burst=100 nodelay;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;
Expand Down
4 changes: 2 additions & 2 deletions backend/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Limit the request rate to 10 requests per second per IP address to prevent DDoS attack
# Limit the request rate to 50 requests per second per IP address to prevent DDoS attack
#
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=50r/s;

#
# Set a response status code that is returned to rejected requests
Expand Down
4 changes: 2 additions & 2 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Limit the request rate to 10 requests per second per IP address to prevent DDoS attack
# Limit the request rate to 50 requests per second per IP address to prevent DDoS attack
#
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=50r/s;

#
# Set a response status code that is returned to rejected requests
Expand Down

0 comments on commit 87c1b3c

Please sign in to comment.