How can I prevent a single IP from downloading brush traffic?

Source: Internet
Author: User
Guys, ask me a question.
My server was downloaded a 300G of traffic a day
See IP is a single IP download but the next day is another IP download one day for a different IP

The server was down for a few days.
How can this problem be prevented?

How do you decide to deal with PHP or Java?

Reply content:

Guys, ask me a question.
My server was downloaded a 300G of traffic a day
See IP is a single IP download but the next day is another IP download one day for a different IP

The server was down for a few days.
How can this problem be prevented?

How do you decide to deal with PHP or Java?

is the single download link being attacked or not fixed?

If you are constantly changing the download address to create an attack, consider using a firewall iptables or third party in a liunx environment 流量控制软件 .

The following is a recommended number of Iptables configuration blog posts, can be referenced below.

Iptables automatically block malicious high-traffic IP
Iptables set Ken Limit traffic
How to limit network traffic with iptables (4)

Put the IP into a map, 0 points a day to clear this map, download the time you can determine if you have downloaded, of course, this number of times you can also control, download how many times, can not download

This question I gave the research, saw Nginx has this function module, HTTPS://WWW.NGINX.COM/RESOURC ..., English I will not translate.
+ + + Split Line 1, time: 2016-10-9 10:30:34+++
Feel the problem or answer is not perfect, the traffic of HTTP request should be divided into request and response two kinds, through Nginx limited access function can only solve the request of the specified IP not processing, response not return the function of data, probably can reduce 90% About the flow, then the remaining 10% or so of the request of the earlier processing the better, see others answer using iptables to limit, this than nginx processing early one step, is a solution, but not perfect, there is no better solution? Just said, the sooner processing the better, you can call the server provider at the routing level of IP filtering restrictions, well, this requires relatively large permissions to do, and may also be related to the network planning flexibility of the server provider you use, then there is no better way, of course, Every time I redirect him to a large domestic internet company large file (already CDN acceleration) Download address, this address I can not say ha, now it is possible to do a line of code to fix the header ("LOCATION:HTTPS://WWW.QUNIMABI.COM/BIGF ... ")。
+ + + Split Line 2, time: 2016-10-9 10:46:05+++
It says that using a code to do, feel still unscientific, it is best to use the Nginx LUA module to determine whether the specified IP in blacklist and then add header redirect to the large file download address.

  • 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.