Just encountered a bug in the network can be re-created, local debugging access to the machine is too fast, configure Nginx successfully reached the speed limit purpose, share it here.
Simple configuration, just 3 lines, open "nginx root directory /conf/nginx.conf" configuration file is modified as follows:
View source code printing help
Code is as follows http{ ……limit_zone one $binary_remote_addr 10m; …… server { location /{ …… limit_conn one 2; limit_rate 40k; } } }
Explanation of the above configuration: limit_zone defines a storage session state for each IP Container. This example defines a 10m container named one, which will be used in the later limit_conn. Limit_conn specifies that each visitor can only create two links, and limit_rate limits the speed of each link to no more than 40K. Therefore, the above configuration limits the maximum speed limit for users accessing this site to 80K.
Property Description limit_zone
Syntax: limit_zone zone_name $variable memory_max_size
Scope: http
limit_conn
Syntax: limit_conn zone_name Allowed Number of links established per client
Scope: http, server, location
limit_rate
Syntax: limit_rate Maximum rate per link
Scope: http, server, location
Case 1: The download resource is placed in the http://domain/download/path. The download speed limit is 100K for each visitor, and only one link can be linked at the same time. Download link.
View source code print help
Code is as follows http{ server { location /download/{ …… limit_conn one 1; limit_rate 100k; } }
} Case 2: Each visitor visits the site The maximum speed is no more than 100K, and 5 links can be established.
View source code printing help
Code is as follows http{ server { location /download/{ …… limit_conn one 5; limit_rate 20k; } } }
Since linit_rate is for each link Speed, the above example has 5 links, to ensure that the total speed does not exceed 100K, each link does not exceed 20K
You are not authorized to view the page, the page cannot be opened; A similar si
I am a fan of web page production, a lot of code needs to be tested and modified, uploading space te
Today, the dealers we talked about in our program provided us with detailed steps
I. Summary This article summarizes how to enable Gzip compression for websites hosted with IIS, the
Five Keys to Hardening Host Security
Website 501 Method Not Implemented Error
Linux to build FTP server with vsftpd
How to choose server host in cloud computing era
Planning server virtualization should consider the top ten issues
Unable to start Distributed Transaction Coordinator service (server error prompt)
Win2K server-side setup Raiders
How to use phpmyadmin to set the permissions of the mysql database user
What is the external host channel? The
Secret: How is the Windows server attacked
How to set properties for Windows 8 VPN
Computer desktop properties can not be opened
Vista/Win7 ADSL local connection is limited
Win10 system update wireless network card driver to ensure normal use of wireless network
Cleverly set up Win7 desktop, turned into news station
Let XP speed up and start a few tips
Windows operating system acceleration installation experience
Win10 mobile phone preview version 10166 quick version update content summary
How to upgrade update step win8.1
Teach you how to calculate the maximum load of the WEB server