Hunk /21,895 views/Updated on October 14, 2019/29 comments
Cloudflare is a well-known American CDN service provider and few of them can use it for free. Although its free version functions have shrunk compared with the paid version, it is still powerful.Today Hunk will introduce the detailed use tutorial of Cloudflare free version
Cloudflare has the following functions:
Free and fast DNS service (effective in 1 minute)
Free SSL certificate
Restrict IP access and other operations in some regions
Prevent network attacks
Website caching and acceleration
One cloudflare account binds multiple websites for free
Note: Cloudflare is a foreign service provider, so the setting of foreign trade websites is meaningful.
1. Register cloudflare account, add domain name and activate email
Enter the cloudflare official website, click sign up, enter the email and password, and then click create account.
Then it will jump to a page, where you need to enter your domain name. If you want to enter multiple domains at once, click I want to enter more domains at a time below
Next, click NEXT, and then select the first free plan. Of course, if you have a budget, you can also select a paid plan. After selecting, click Confirm Plan, and then click Confirm
Then click continue, and it will jump to a page where all the original DNS records of your domain name will be imported, so that the original website, mailbox and other services will not be affected after you switch to NS.But please note that you need to check whether the records imported here are all records, because occasionally Cloudflare will miss some. If you find some DNS records are not imported, you need to record them in whatsmydns.net to check all the original records, and then make up after the NS server switches to Cloudflare, otherwise some services will fail)
In addition to importing the original DNS records, the following will also prompt you how many NS servers are on Cloudflare. I need to copy the two server values, and then go to the background of your domain name purchase to modify the NS server to these two values
You need to copy and record them in the document, and then go to your domain name management background to change the NS to these two. If you have multiple NS servers, delete the others, and only keep these two.Refer to the method for modifying NSMethods of modifying NS for Namesilo, godaddy and HiChina domain names
After the modification is successful, wait 1-2 hours for it to take effect.
Finally, you need to go to the mailbox you registered for CLOUDFIRE, click verify in the received cloudflare verification email, and complete the verification of the mailbox.
2. Cloudflare overview menu settings
Wait a few hours, log in to the cloudflare account, and then click the domain name to be set to enter the setting menu.
First, let's look at the overview menu. This is a shortcut to all the main menus of Cloudflare, so we don't need to pay attention to most operations.
Only two shortcut operations can be opened when needed.
One is under attach mode, that is, when your website is attacked, you can open it to prevent attacks.
The other is development modeThat is, when you want to see the result of the modification immediately when you modify the website, you can open it, so that the latest website page will be directly displayed instead of being cached.
If the above two settings are not needed, they will remain off.
In addition, you can see the traffic under the website, cache conditions, etc., and understand the basic situation of the website using cloudflare.
Other shortcut settings will be set on a separate page later.
3. Cloudflare Analytics menu settings
Here we mainly look at some analysis data after the website uses Cloudflare. Analytics contains several submenus, including Traffic, security, performance and DNS
Introduction to Traffic Menu
It mainly checks the website's requests, bandwidth, and visitors in a certain period of time in the past.
At the same time, the data of requests, bandwidth and visitor distribution of different countries will be displayed below for viewing.
Security Menu
This menu is mainly about safety information display
Threats
It displays data about threats received in a certain period of time, including the number of threats, countries from which they come, types of threats, etc.
Threats by Country
Data on threats from different countries
Rate limiting
This is a paid function. The free version doesn't work
Overview
List of safety related data
Performance Menu
Origin performance(Argo)
This is a paid function. The free version doesn't work
Here is a preview of some performance data
DNS Menu
Mainly check some data queried by DNS
4. DNS menu settings of Cloudflare
In the DNS menu, you can add or delete all DNS records at will, or choose to use or not use the cloudflare service.
Here is a brief introduction to the method of adding DNS records in Cloudflare
1) First click A on the left, and then select different record types A, cname, MX, TXT, etc
2) Next, enter the name of the record you added in the Name box. If it is website resolution, it is usually filled in www or not. If it is email resolution, it is generally left blank,
3) Then enter the value of the record you want to add in the third box. For record A, fill in the IP address of the space you use, for cname record, fill in the domain name, and for MX record, fill in the record value provided by the enterprise mailbox, and fill in the corresponding priority.
4) After filling in the three items, click ADD record to add successfully.
It is very simple to delete a record. Click the fork directly behind the record to delete it.
The website uses the service settings of CLOUDFIRE
Only record A or cname can be set to use CDN service
The method is also very simple. Just add the small cloud icon behind the A record, light it up, and it will switch to the state of using CDN.
If you don't want to use Cloudflare's CDN service, just click it again to turn it off and turn it gray, and then the CDN service will be turned off. Only Cloudflare's DNS is used.
Note: All the settings in this article will take effect only when this small cloud icon is turned on!
The other three menus
Cloudflare Nameservers
What is displayed here is the nameservers you use in Cloudflare
Custom Nameservers
This is a paid version function. The free version is not available
DNSSEC & CNAME Flattening
Don't worry about it
5. Crypto menu setting of Cloudflare
This is mainly about the setting of website encryption to strengthen website security
SSL
If your original website has an SSL certificate, select full here
Edge Certificates
The free cloudflare account does not need to be set here.
Custom Hostnames
The paid version of cloudflare only has functions
Origin Certificates
If your original website does not have an ssl certificate installed, you can generate a certificate here and install it on the original space of your website.However, Hunk does not recommend this.
It is better to install SSL directly in the original space.Now many spaces can install ssl with one click, such assiteground,Very convenient.
Select 1.1. If the selection is too high, the website may not open
TLS 1.3 & Automatic HTTPS Rewrites
Open it
Disable Universal SSL
Keep this as the default
6. Firewall menu settings of Cloudflare
In the Firewall menu, you can further set the website security and restrict the access of users from certain IP addresses or regions.
Events submenu
Here, you can view some small events of the firewall. For example, in the picture, some accesses are blocked after Hunk sets filter conditions
Managed Rules submenu
Here are the paid cloudflare settings, and the free version can't be used
Firewall Rules
Here you can set rules that restrict other people from accessing your website. Each account can only set 5 restrictions.
Here, you can set many desired shielding domestic IP access. First, click create a firewall rule
In the open window
Rule name
In Field, you can select different filter objects. You can set the IP address or the country. Let's take the country as an example
The operator sets operations here, and can select equal,
Value Fill in the countries you need to block here. Let's take China as an example
Edit expression
Choose an action
Finally, click deploy to add the rule.
This operation means that when Chinese users visit your website, they will be blocked directly.
Then you can see it below.
If you don't need this RULE, click on "On" to turn it off
TOOLS
The functions here are complementary to those of the firewall rules. They all make some necessary settings for users to visit your website
IP Access Rules
Mainly set some rules for IP, IP range, country and ASN
It should be noted that some functions can only be used in the paid version.
The operation method is also very simple. Take shielding IP as an example.
In the first box, enter an IP address, and then select a rule in the second box. In the third box, select the valid website or all websites on the cloudflare.
Add a note is to add a note, and then click Add.The settings are relatively simple.
Rate Limiting & Zone lockdown
Paid function
User Agent Blocking
You can limit the proxy settings used by users, such as browser type, CPU or operating system.
This operation doesn't work much, so I won't demonstrate it for the moment.If you have friends in need, you can study it. It's not difficult to operate.
Settting
Here are some other settings
Security Level
This setting is low. If it is set too high, it will be too sensitive, causing many users to be affected
Challenge Passage
This is the validity period of the validation, which can be set a little longer
Browser Integrity Check and Privacy Pass Support
Both are set to ON, open mode.
7. Speed menu setting of Cloudflare
Auto Minify
Minimize web pages by ticking Javascript and css html.
Polish / Railgum
Paid function
Brotli
This is a better web page compression method than gzip. Open it
Mirage
Paid function
Rocket Loader
This requires testing to decide whether to open it. There is no fixed answer.
You can open it and view the effect of the web page in different browsers. If there are problems with web page layout, close it.
Mobile Redirect
This can be set to jump to different links when you open your website on your mobile phone.
If you have a special mobile site, you can set it. If you don't have or need this setting, you don't need to set it.
The method is very simple. First select the target link you want to jump to, then select keep path, and then switch to On below.
If it is not needed later, turn off the switch below.
Prefetching URLs From HTTP Headers
Paid function.
8. Caching menu setting of Cloudflare
Here are some settings for caching
Purge cache
This setting is to clear the cache
Custom purge can clear the cache of the specified page
This operation is also relatively simple. Click custom purge, enter the link to be cleared in the box, and then click purge.
Purge everything is to clear the cache of the entire website
Caching Level
Select standard here
Browser Cache Expiration
This is modified according to your own situation, and it is recommended that it be more than 7 days
Always Online
Just tick here
Development Mode
Because Cloudflare uses caching technology, when you update the content of the website, you may not be able to see the updated content in the foreground immediately.
At this time, you can see the updated content of the website as soon as you open the development mode.Of course, it is better to turn it off under normal circumstances.
Enable Query String Sort
The function of the paid version.
9. Page rules menu setting of Cloudflare
The free version can set the rule of three pages. If you want to buy more, you need to buy it.
There are many rules that can be set. One of the most useful ones is forwarding, which is 301 jump. There are many applications.
Here's a simple demonstration. For example, I want to jump to Baidu from my website wpshare.org
Click create page rules, and then enter the URL of the page you want to jump to in the first box. If you want to jump to the entire website, just add * after the full link.
If you only need to jump to a page, just fill in the URL of the page.
Then click Add settings below
Then expand pick a setting, and select 301 – permanent redirect in select a status code.
Enter the target link Baidu you want to jump to in the bottom box at the back.
Finally, click save and deploy to succeed.
After successful addition, the page rule will be listed below. If you do not cancel, just change the following on to Off
10. Network menu setting of Cloudflare
Leave all options as default.
11. Apps+menu settings of Cloudflare
Under this menu, you can install some software on the website to enhance its functions.Here's an example.
First, search for the type you want to add in this box. Let's add a whatsapp chat tool to directly search for what
Then the whatsapp tool will appear in the following results, click it, and then click preview on your site
Then enter CALL TO ACTION and your whatsapp account on the left side, and select where whatsapp is displayed.Finally, click install on all pages to successfully install.
However, the free version can only be displayed on the home page, and other pages cannot be displayed.In addition, if you install other tools, the settings of each tool are different, and you need to set them according to the situation.
12. Access, Custom Pages, Traffic, Steam and other menu settings
These are all paid versions that can be used. Don't worry about them.
Scan and share the circle of friends
Follow Hunk WeChat official account
Hunk has entered the foreign trade industry for 10 years, engaged in foreign trade business, and transformed technology for 12 years, engaged in foreign trade station building marketing.If you are going to build an independent foreign trade station, we have many professional technical articles for your reference.Hunk recommendsPurchase domain name on namesilo, onsitegroundorcloudwaysBuy space on and use Google email.Of course, if you are not good at technology and have no time to study, you can findHunk outsource to build a website or pay for solving problems。
Others have seen:
New choice of foreign trade station building space – purchase and use of Cloudways (including discount code)
What if Bluehost doesn't want to renew?What if Bluehost automatically renews and deducts money?What if Bluehost is expired?
Excellent Website Acceleration Plug in - Detailed Setting Tutorial of WP Rocket
How to choose a foreign trade site building space: Siteground vs. Linode?
How to outsource logo and hand drawn video on fiverr (from 6USD)
Which company will be used for 2023 foreign trade station construction space? –Siteground purchase and use tutorial (install wp and ssl, etc.)
29 replies on "How to use CDN to speed up your website - detailed use tutorial of Cloudflare free version"
The writing is very good. The landlord has worked hard!
Hello Hunk,
Do you have a setup tutorial for Cloudflare Pro? Try to pay for one month. Many of the settings are incomprehensible and you dare not set them at will.
HUNK, Hello!Could CLOUDFIRE be used to block Chinese system language computers from accessing my website?How can I operate it if I can
How to find the IP address in the added DNS?
Go to the domain background to find
Hello, after I open the proxy function of Cloudflare, that is, CDN, v2y cannot access the network.If you only use DNS services, v2 is OK.What's the problem?
Cf has blocked your V2 link.Change the tools and use them.
Hello!Can this platform free our VPS
You are driving a 1.5L naturally aspirated car, accelerating at 100 meters for 10S. Now add a turbocharger to your car, and the acceleration at 100 meters becomes 8.5S. Can you remove the 1.5L engine?
This metaphor is very good. It makes people understand the relationship between these. I would like to ask the blogger, the siteground host I use, has its own CDN acceleration, so you don't need to use Cludflare's CDN acceleration?
After using CloudFlare, the sender's IP addresses shown in contact form 7 are all CloudFlare's IP addresses, and the original sender's IP address cannot be seen. How to solve this problem
Brother, hello, I want to ask how to set firewall rules to achieve the effect of setting ddos protection?
Attacked mode, my blog has written
Hello Hunk,
Could you tell me if Cloudfare can only use the domain name with www instead of www?(Said by SG customer service)
Don't worry about SG. Don't use CF in the background of SG. It's not easy to use.Follow my tutorial directly. The root domain name and secondary domain name can be used
Could you tell me whether Cloudfare third-party resolution can only add 50 domain names and can't add any more
How to understand the domain name resolution? My NS has already filled in the siteground. If it is replaced with cloudflare, it will not cause problems on the website
No after setting. It depends on blog operation
Hello, HUNKLet me tell you something: my website uses the server of LINODE, and the name servers are also the default of LINODE. But my website pictures occupy a large amount of memory, which greatly affects the website speed.In this case, can I use Cloudfare's free CDN acceleration to improve the website speed?thank you..
Yes, you can try it.The problem of pictures should be solved separately
Liaoshen, our customers are mainly from Southeast Asia and Africa. Which location should the server choose best?
Singapore or America
that 's great.After using the resolution of linode, you can't use cloudflare
It is OK to use NS of CLOUDLARE, and the parsing speed is fast
Hello, let me ask you a question.Is there any specific traffic limit or anything for the free cloudflare CDN acceleration?
No limit.Only function restrictions
Hello, HUNK, I tried NS pointing to cloudflare. It's true that the network speed will be very fast, but I can't receive emails.I am Bluehost space.I'm not sure if it will conflict with the transit mailbox server.
The website of BLUEHOST space receives inquiries, which has not been solved for a long time. It is lucky to receive them, but it is normal not to receive them.
If possible, you'd better change to sg, which is much faster, and there will be no trouble of not receiving inquiry emails. Please refer tohttps://www.imhunk.com/2018-website-hosting-siteground-and-install-wp-ssl/
I just raised the issue of cloudflare on the Liaoshen blog, but I didn't expect Hunk to act so quickly.Like one!