添加 limit/limit.md

This commit is contained in:
2026-03-30 20:25:06 +08:00
parent 904d3a3a84
commit 9dfbe66673

28
limit/limit.md Normal file
View File

@@ -0,0 +1,28 @@
## nginx.conf
```shell
limit_req_zone $binary_remote_addr zone=req_limit_zone:10m rate=10r/s;
limit_conn_zone $binary_remote_addr zone=conn_limit_zone:10m;
limit_req_status 429;
limit_conn_status 429;
```
## limit.conf
```shell
limit_req zone=req_limit_zone burst=100 nodelay;
location = /robots.txt {
default_type text/plain;
return 200 "User-agent: *\nDisallow:\n";
}
```
## server.conf
```
server {
...
include limit.conf;
...
}