这样设置的目的是防止单个ip过高的访问,导致服务器资源耗尽
http {
: limit_zone one $binary_remote_addr 10m;
定义一个叫“one”的记录区,总容量为 10M,以变量 $binary_remote_addr 作为会话的判断基准
: ...
: server {
: ...
: location / {
: limit_conn one 20;
表示同一个ip并发访问为20,超出服务器就会提示 Service unavailable" (503)。
: }