A
A
AlexWinner2010-12-29 18:06:48
Nginx
AlexWinner, 2010-12-29 18:06:48

Nginx: How to limit the number of connections for different virtual hosts?

Hello!
Can you please tell me if it will be possible to limit the number of connections
for various hostnames using directives from the
ngx_http_limit_zone_module module?
For example, do this:
limit_zone one $hostname 10m;
limit_conn one 10;

Those. so that for each hostname there can be no more than 10 simultaneous connections.
If that doesn't work, what's the best way to implement this constraint?

Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Hint, 2010-12-29
@Hint

Wait. And how does the server know which virtual host the client will make a request to? This information is passed in the HTTP header after the connection has been established.

A
Alexander, 2010-12-29
@akalend

The ngx_http_limit_zone_module module allows you to limit the number of simultaneous connections for a given session or, as a special case, from one address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question