After enabling CDN, the website obtains the user's real IP: Cloudflare CDN real IP address (Nginx, Apache)

Recently, when Qiufu was maintaining a client's website, the client requested that access from foreign IPs be blocked. According to the logs, most of the attacking IPs came from abroad, and the target users were domestic, so only domestic IPs were allowed to access the website. Can block the vast majority of CC and DDoS attacks. After actual testing, it was found that the effect is still good, and the cost of attacking again has increased a lot.

Self-built CDN acceleration-Nginx reverse binding, cache acceleration, automatically update cache and obtain real IP

Although the blog is now placed on Alibaba Cloud Hong Kong CN2 VPS host, Telecom uses the CN2 line, so the access speed will be faster (but I have also received feedback from friends of Telecom that access is slow (⊙﹏⊙)). However, China Unicom and mobile users will have slower access, especially during the evening peak period. Many friends said that they cannot open it at all.

Subscribe to Nginx CDN setup