Skip to content

Commit

Permalink
Merge pull request #3 from i3thuan5/limit_req
Browse files Browse the repository at this point in the history
限制一IP連線數量
  • Loading branch information
a8568730 authored Jan 2, 2025
2 parents ca5d53f + d0743dd commit 0f7e32c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hokbu-nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ upstream backend {
server hapsing:5000;
}

limit_req_zone $binary_remote_addr zone=ip:10m rate=3r/m;

server {
listen 80;

Expand All @@ -15,5 +17,7 @@ server {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://backend;

limit_req zone=ip burst=30 nodelay;
}
}

0 comments on commit 0f7e32c

Please sign in to comment.