How to limit downloads and concurrent speeds in Nginx

Source: Internet
Author: User

1. Add Limit_zone (this variable can only be used in the HTTP protocol)

2. Edit Nginx.conf File

Add Limit_zone one $remote _addr 10m instructions to it, and then add Limit_conn, because this variable is used in HTTP, server, location, and restricts only one site, so add it to the server

Http://wiki.nginx.org/NginxHttpLimitZoneModule Download Limit_zone

Http://wiki.nginx.org/NginxHttpCoreModule Downloads Limit_rate and Limit_conn

Limit_zone, which defines a container that stores session state for each IP, is defined as 10m,

Limit_conn one 2;

Limit only two concurrent connections per IP

Limit_rate 30k;

Set each concurrent connection to 30k, to the connection speed limit

This column more highlights: http://www.bianceng.cn/Servers/web/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.