Nginx limits the number of concurrent connections for a single IP

  
 

Using Nginx to limit the number of concurrent connections to a single IP can reduce some acquisition programs or DDOS attacks. In lnmp's nginx configuration, some code has been added, but it is commented out. You can edit the /usr/local/nginx/conf/nginx.conf file to find it:


The front # Remove, then add


The last digit of the limit_conn statement is 20 for the maximum number of concurrent connections for a single IP.

Detailed official rules:

http://wiki.nginx.org/NginxChsHttpLimit_zoneModule

Use Nginx as a web server. If the log is not processed, the log file may Very scary ~10G, 20G

You can modify nginx.conf to find access_log:

access_log /dev/null;error_log /dev/null;

Throw them all The black hole of the system does not need to read and write the log to the system disk all the time, and also extend the life of the hard disk.

After the modification, restart Nginx ( kill -HUP `cat logs/nginx.pid` ) can.

Copyright © Windows knowledge All Rights Reserved