Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Nginx by default waits for session to be closed until it opens a new session. this is a problem if a user tries to download more than one archive at once.

How to disable or upper the limit?

what i've tried:

changing  rate=1r/s to rate=100r/s  
limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;

nginx conf:

server {
    #limit_conn addr 3;
    #limit_rate_after 2048k;
    #limit_rate 300k;
    access_log off;
    #access_log  /var/log/nginx/  main;
    error_log   /var/log/nginx/  crit;
    #open_file_cache max=3000 inactive=120s;
    #open_file_cache_valid 30s;
    #open_file_cache_min_uses 2;
    #open_file_cache_errors off;
            location / {
                 valid_referers none blocked * *;
                 if ($invalid_referer) {
                    return   403;
                    root /var/www/;
                            aio on;
                            directio  4k;
                            directio_alignment 4k;
                            output_buffers 1 1m;


http {
    access_log  /var/log/nginx/access.log  main;
    client_max_body_size 2005m;
    server_names_hash_bucket_size 64;
    client_body_temp_path /tmp;
    client_body_in_file_only clean;
#    limit_conn_zone $binary_remote_addr zone=addr:10m;
    send_timeout 30;
    keepalive_timeout 60;
    proxy_buffering off;
    tcp_nodelay    on;
    log_not_found on;
    tcp_nopush     off;
    sendfile off;
    reset_timedout_connection on;
    limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
    index  index.php  index.html;

share|improve this question

Changing rate=1r/s to rate=100r/s should work, unless your client needs more than 100 requests per second to download 2 files... Normally downloading 2 files requires 2 connections.

However, to me using rate-limiting to limit the number of simultaneous connections is using the wrong tool. You have something called limit_conn which... limits connections! Not rates... It works the same way, as you can define the zone against clients IP address. You then decide on the limit, which is a raw number.

Again, those are 2 different problem: connection rate and amount are not to be confused, though one might interfere with the other.

Try disabling rate-limiting and use connection-limiting with 2 connections per client. Ensure your client works properly.

THen, you may wish to reinstall rate-limiting, taking good care that it does not interfere with your client usage. You may want to allow bursts of connection if your rate limit is low. Use then logs against failed connections to know if either limit_conn or limit_req is hold responsible for it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.