I want to limit connections count to location from same ip and if limit was reached - throw 503 http error to client. It seems that, it's possible to do with limit_conn as described in doc http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html.
But I've strange behaviour - nginx(v1.2.1) just waiting until client finish file downloading, and then send same file again for the pending request.
Here is my nginx config:
http {
limit_conn_zone $binary_remote_addr zone=addr:10m;
...
server {
...
location ~* "^/d/" {
limit_conn addr 1;
limit_rate 128k;
}
...
}
...
}
What I'm doing wrong? Is it possible to abort pending request with http error?
But I've strange behaviour - nginx(v1.2.1) just waiting until client finish file downloading, and then send same file again for the pending request.
Here is my nginx config:
http {
limit_conn_zone $binary_remote_addr zone=addr:10m;
...
server {
...
location ~* "^/d/" {
limit_conn addr 1;
limit_rate 128k;
}
...
}
...
}
What I'm doing wrong? Is it possible to abort pending request with http error?