K7

K7Blog

须知少年凌云志 曾许人间第一流.
proton
telegram

Scan and accelerate websites or nodes using Cloudflare reverse proxy. Create your own CDN acceleration for free.

Preface:#

Recently, I have been using a home mini server to provide scientific internet access for my home devices. I usually prefer to use high-speed nodes, which can cause the traffic to run faster. So I decided to set up a proxy node on a Hong Kong BPG server to provide acceleration for large traffic. However, the network connection is not very good and the speed is very slow, even when using Cloudflare nodes. Although the speed improved slightly during the YouTube playback test, the latency was still high.

Follow-up: Continued from the previous article: Scanning Cloudflare's IP for reverse proxy to accelerate websites or nodes - Free creation of your own CDN acceleration

So I watched a video by Liang Lin on YouTube:

I scanned the IP for reverse proxying Cloudflare to accelerate the nodes and found an IP that significantly improved the speed and latency:

Snipaste_2024-04-29_20-15-53

With a speed of over 400,000 Kbps, even when I connect directly or use Cloudflare, I only get a few thousand to tens of thousands. This speed improvement is remarkable. So I thought, if I can accelerate the nodes, can I also accelerate websites that are using Cloudflare? So I tinkered around and found a solution. If you're only interested in accelerating nodes, you can directly watch the video to learn the operational process. If you want to accelerate websites that are using Cloudflare, you can also watch the video first to see how to scan Cloudflare's IP for reverse proxying before continuing with the following content.

User Guide:#

The video above teaches everyone how to speed up a VPS server that has set up nodes. No matter how poor the network connection of your machine is, you can still experience a significant improvement. Similarly, we can directly accelerate websites that are using Cloudflare with these reverse proxy IPs. I recommend that everyone watch the video first to learn how to obtain reverse proxy IPs.

Further reading: Using Cloudflare CNAME to access custom domains

Accelerating website access for domestic users through CloudFlare+SaaS origin IP optimization

Cloudflare for SaaS

I didn't find any mention of fees in the official Cloudflare documentation, so it should be free. When you sign up, you will need to authorize a credit card or PayPal.

Obtaining Reverse Proxy IPs:#

First, we open: https://fofa.info After opening, everyone can register an account first, and then you can export and download later.

Reference search syntax:

Domestic reverse proxy IPs: server=="cloudflare" && port=="80" && header="Forbidden" && country=="CN"
Exclude CF: asn!="13335" && asn!="209242"
Alibaba Cloud: server=="cloudflare" && asn=="45102"
Oracle Korea: server=="cloudflare" && asn=="31898" && country=="KR"
BandwagonHost: server=="cloudflare" && asn=="25820"

Based on these syntaxes, everyone can search for reverse proxy IPs for Cloudflare on their own. There is one question regarding whether these node IPs can be used to accelerate both nodes and websites. I have tested it and it is possible. During my testing, I directly filtered out the IPs that can be used for node acceleration based on the video tutorial above, and then proceeded to accelerate the websites.

As for those IPs that cannot be used for node acceleration, whether they can be used to accelerate websites, you need to try it out for yourself. I feel that theoretically, it should be possible. There is also one question: in the video, there is node acceleration for ports 80 and 443. Some IPs can accelerate both ports, while others can only accelerate port 80 and not port 443. In my testing, those IPs that cannot accelerate port 443 for nodes can still be used to accelerate websites without any issues.

Website Acceleration:#

First, we add an A record resolution, and the resolved IP is our server's real IP (enable proxy? I enabled it, not sure if it has any impact if not enabled):

Snipaste_2024-04-29_20-36-04

Then, in the sidebar, go to SSL/TLS - Custom Hostnames:

Snipaste_2024-04-29_20-36-42

In the fallback origin section, enter the domain name you just resolved. After saving, the fallback origin status should be valid before proceeding with the next steps:

Snipaste_2024-04-29_20-37-09

Next, add another custom hostname (the domain name you want to accelerate):

Snipaste_2024-04-29_20-41-30

Snipaste_2024-04-29_21-20-50

There are two certificate verification methods: HTTP verification and TXT verification. You can choose either one, and then you will get the content that needs to be resolved, as shown in the image below:

Snipaste_2024-04-29_20-41-51

Snipaste_2024-04-29_21-21-31

Once you have resolved the domain name verification, you can then resolve the A record of the domain name you want to accelerate to the reverse proxy IP of Cloudflare. You can use tools to filter out IPs with lower latency within China.

Frequently Asked Questions + Advanced Techniques:#

Follow-up: Continued from the previous article: Scanning Cloudflare's IP for reverse proxy to accelerate websites or nodes - Free creation of your own CDN acceleration

Let's assume that my fallback origin is set to dns.k7blog.com (resolved to the server IP) and my accelerated domain name is cloudflare.k7blog.com.

If my cloudflare.k7blog.com domain name, due to poor or failed reverse proxy node speed, I change the resolution record, then the status of cloudflare.k7blog.com in SSL/TLS - Custom Hostnames will show as invalid, and I will need to re-resolve it based on the new resolution.

If we frequently update the resolution and need to re-validate the hostname status each time, it can be troublesome. We can directly set a new resolution, such as dns2.k7blog.com, and resolve this domain name to the reverse proxy IP of Cloudflare. Cloudflare supports multiple IPs for a second-level resolution. Then, we resolve our accelerated domain name, cloudflare.k7blog.com, to dns2.k7blog.com. This way, we can control the dns2 domain name each time we change the node IP, and we won't have to frequently re-validate the hostname status.

For example, if your domain name resolution is on a domestic server and you want to use Cloudflare to accelerate overseas access speed or for defense, you can also use the access method described in the tutorial above. The disadvantage is that you must have a domain name on Cloudflare. If your DNS resolution supports intelligent resolution, you can provide this method to distribute overseas resolution to reverse proxy IPs of Cloudflare.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.