|
Recently, my site has been attacked by malicious DDOS This causes the server to go down and prevent the service from being provided normally, which is very annoying So I added a new version of Baidu Cloud Acceleration to provide CDN services and protect the website Introduction to the new version of Baidu Cloud AccelerationHome:http://next.yunjiasu.baidu.com/ Attention! Nohttp://yunjiasu.baidu.com/,尽管UI完全一样,但是功能相差非常大! The new version of Baidu Cloud Acceleration not only adds new domestic nodes, but also adds overseas nodes! In other words, unregistered websites can also use Baidu Cloud Acceleration! Moreover, Baidu Cloud's accelerated overseas nodes are actually CloudFlare's paid version of the service, and the powerful performance of CloudFlare's CDN goes without saying, with rich nodes around the world (except Chinese mainland), and super anti-D capabilities Turn on Baidu Cloud Acceleration1. Log in to your Baidu account 2. Click "My Website" in the upper right corner 3. Click "Add Website" 4. Then enter your domain name, then click to select the access method, and select "CNAME method". 5. Click "Next" and wait for Baidu to synchronize information with CloudFlare, which may take longer 6. Next, you will enter the steps of setting up records, and follow Baidu's prompts to set records-modify resolution-verify domain names 7. Add successfully! 8. Next, your website will be under the protection of Baidu! Block non-CDN accessIf the attacker already knows your real IP and directly attacks your real IP address, then Baidu Cloud Acceleration, to be precise, CF, will not be able to protect you To avoid being attacked from behind, we need to make some restrictions on nginx Add the following code to the server section of nginx: - allow 127.0.0.1;
- allow 你VPS的IP地址;
- #CloudFlare
- allow 199.27.128.0/21;
- allow 173.245.48.0/20;
- allow 103.21.244.0/22;
- allow 103.22.200.0/22;
- allow 103.31.4.0/22;
- allow 141.101.64.0/18;
- allow 108.162.192.0/18;
- allow 190.93.240.0/20;
- allow 188.114.96.0/20;
- allow 197.234.240.0/22;
- allow 198.41.128.0/17;
- allow 162.158.0.0/15;
- allow 104.16.0.0/12;
- deny all;
Copy codeThis code means that only the IP address of the CF and the VPS are allowed to access nginx locally, and all other access is rejected (403). This can minimize the risk of attackers directly attacking real IPs Causing the website to crash |