Nginx learns how to prevent traffic attacks

scenes to be used Recently, the related configuration of the report query system load balancing cluster has been completed. The two implementation methods are session management strategies based on Ehcache and Redis respectively. We all know that server resources are limited, but requests from clients are unlimited (malicious attacks are not ruled out). In order to ensure that most requests can be responded normally, some requests from clients have to be given up, so we will use Nginx Current limiting operation, this operation can relieve the pressure on the server to a great extent, so that other normal requests can be responded normally. How to use Nginx to implement basic current limiting, such as limiting a single IP to 50 visits per second. Through the Nginx current limiting module, we can set that once the number of concurrent connections exceeds our setting, a 503 error will be returned to the client. This can be very effective in preventing CC attacks. Combined with the iptables firewall, basically CC attacks can be ignored. how to use conf configuration #Unified configuration in the http domain #Limit requests limit_req_zone $binary_remote_addr $ uri zOne=api_read:20m rate=50r/s; #Configure a connection zone by ip limit_conn_zone $binary_remote_addr zOne=perip_conn:10m; #Configure…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索