28 lines
502 B
Markdown
28 lines
502 B
Markdown
|
|
## 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;
|
|
...
|
|
|
|
} |