Preface
What is meant by "having a public IP for website building but no legal port 80 or 443"? This mainly refers to two scenarios: home broadband with a public IP, and cloud hosts without ICP filing.
Home broadband with a public IP
Nowadays, for home broadband with public IPs (mainly IPv6 public addresses and a small amount of legacy IPv4 public IPs), ports 80 and 443 are directly blocked at the network level. However, most people are used to simply typing the domain name into the browser's address bar and pressing Enter to access a site; very few can accept typing the full link followed by a port, for example:http://www.example.com:55555orhttps://www.example.com:55555(Even if someone is willing, they would feel it lacks class...), and the prerequisite for being able to access a site directly by typing the domain name in the browser's address bar and pressing Enter is that ports 80 and 443 are available. Therefore, for friends who have home broadband with a public IP and want to use it to build a website, solving the issue of ports 80 and 443 is the very first problem that needs to be addressed.
First, a bit of small talk. Actually, it is very difficult for newly installed home broadband to get a public IPv4 address now. According to the reply from Chengdu Telecom, it seems that starting from 2022, the country has been promoting some "strong nation" policy, and public IPv4 addresses are no longer allocated for newly installed broadband (unless you use a package of 399 RMB or more and pay an extra 100 RMB service fee per month~~~ are you scared yet?), but public IPv6 addresses are available. Existing public IPv4 addresses are basically retained by default for old users, and if these old users upgrade their packages, there is no guarantee that they will even keep their public IPv4 address (it is said that complaining to the MIIT could get the public IPv4 address back, but it might take half a month to a month; I think if it really is a national policy, it's hard to say whether complaints will work in the future). Of course, if multi-dialing is not considered, from the perspective of building a website, there is no difference between IPv6 and IPv4. In fact, public IPv6 addresses can also be used for multi-dialing, but it is not yet popular and the cost of use is relatively high. I will write a separate article about this when I have time in the future.
Having a cloud host but the domain name is not ICP-filed
With a cloud host, you have a fixed public IPv4 address, and ports 80 and 443 are open at the network layer. However, if your domain name is not ICP-filed, even if you resolve the domain name to the fixed public IPv4 address of the cloud host, it still cannot be accessed. This is due to the existence of the ICP filing system. Simply put, as long as it is the HTTP protocol, whether it is HTTP (port 80) or HTTPS (port 443), ubiquitous monitoring will inspect the Host field of your HTTP request, extract the accessed domain name, and compare it with the whitelist in the ICP filing database. If it is an ICP-filed domain name, you are allowed to access it normally; if it is not ICP-filed, a corresponding prompt box will pop up based on which cloud provider the resolved IP belongs to. For example, if the IP belongs to a Tencent Cloud host, the following prompt will pop up:

At this point, your access request is forcibly redirected to this page before even reaching its destination. It is worth mentioning that this detection and interception only target ports 80 and 443, which means HTTP and HTTPS access without specifying a port. Therefore, if you add other ports (non-80 and non-443), it is not affected by the ICP filing system. Of course, normal people are not willing to add these ports either.
These two scenarios above are probably the ones we encounter most frequently. Therefore, whether for friends who want to build a website using home broadband with a public IP, or those who have a cloud host with a fixed public IP but do not want to file for an ICP license, the top priority to resolve is definitely the issue of being unable to use ports 80 and 443.
So how do we solve this problem? To explain this clearly, we first need to understand the concept of the ”origin server” corresponding to a CDN.
CDN origin server
Simply put, a CDN is a large distributed reverse proxy, and the ”origin server” is the access URL of the backend real server that needs to be specified when configuring the reverse proxy. Taking the reverse proxy configured in the Baota Linux panel as an example:

The ”origin server” of a CDN is similar to the target URL configured in the red box of the reverse proxy.
If the domain name is ICP-filed, you can use the CDN services of domestic cloud providers. Let's take Tencent Cloud's CDN configuration as an example to look at the options:

As you can see, Tencent Cloud's CDN offers options for origin type, origin protocol, origin address, and origin HOST. Most importantly, the origin address can be an IP or a domain name, and the port is optional, meaning it can be a non-standard port (other than 80 and 443). Combined with the origin HOST that can be specified separately later, this opens up a huge range of possibilities. For example, specifying the origin as a domain name like
source.example.com, and setting the port to 55555, you can directly point the origin to an institution or individual providing similar hosting services (such as home broadband with a public IP). Then, as long as you correctly configure your own website domain name as the origin HOST on that device, it can serve as the CDN origin (this is how my blog is set up, which is why I call it a home data center).
Unfortunately, Cloudflare's default DNS proxy mode does not allow you to specify ports like Tencent Cloud's CDN does:
For example, the free version of Cloudflare:

This means the origin address can only be an IP, with no port option, which in turn means only standard ports can be used (80 and 443 in mainland China, with more default ports in other regions). There is no origin HOST option, meaning that on port 80 or 443 of the specified IP: 43.44.45.46, there must be a site named blog.example.com, unlike Tencent Cloud's CDN configuration where the origin HOST can be a different site name.
It is indeed impossible to set the origin site name arbitrarily like in Tencent Cloud's CDN (after all, Cloudflare works based on DNS domain names), but must the origin port really be limited to 80 and 443? The two main scenarios mentioned earlier do not have ports 80 and 443 available.
Actually, this can still be resolved, and it is achieved through Cloudflare's Origin Rules feature.
Origin Rules

As shown in the figure above, the official description is: ”Customize where matching traffic goes and with what parameters. Allows Host Header, SNI, DNS record, and destination port overrides.” Note the destination port override, which allows you to customize the destination port of the origin.
Click "Create Rule":

The image above shows the creation of the simplest origin rule: when the incoming request is HTTPS (Cloudflare automatically applies HTTPS anyway), the destination port of the origin is changed to 55555. Of course, you can also add rules using "and" or "or", for example:

As shown in the image above, after adding an "and", only when accessing
https://www.example.comthis hostname will the origin port be 55555. This allows different hostnames to correspond to different origin ports, making it much more flexible. In addition to hostname and SSL/HTTPS, there are many other options for conditions:
You can choose according to your needs.
Disadvantages
While this method indeed solves the port 80 and 443 issue, it has the following two drawbacks:
The domain's DNS resolution must point to Cloudflare
If the domain was purchased from a domestic DNS provider (such as Alibaba Cloud or Tencent Cloud), you need to point the DNS to Cloudflare and make the corresponding settings (for specific steps, you can refer to my other article:Clever Tricks Series: Getting Cloudflare for Free via Domestic ICP-Filed Cloud Hosts to Achieve Fast Access to Domestic Sites from Abroad)
Access speed from mainland China is hit-or-miss
Because using Cloudflare to build a website makes it an ”overseas” site, and since it is not ICP-filed, there is negative optimization in mainland China, and the access speed across different provinces is hit-or-miss. So if you care a lot about the domestic user experience, you'd better just go through the ICP filing process properly.
Note: Currently, for building websites using Cloudflare, I provide two solutions for those with and without public IPs: those without a public IP can only use the Tunnel method (see:Clever Tricks Series: Getting Cloudflare for Free via Home Broadband Without a Public IP to Achieve Fast Website Building (Universal)), while those with a public IP are further divided into those with legitimate ports 80 and 443 (see:Clever Tricks Series: Getting Cloudflare for Free via Domestic ICP-Filed Cloud Hosts to Achieve Fast Access to Domestic Sites from Abroad) and no legal 80/443 ports (which is the method in this article). Among them, Tunnel can be used regardless of whether there is a public IP, making it a truly universal method. The speed is not necessarily much slower, and crucially, it is safer (after all, it directly penetrates into the internal environment). Therefore, under normal circumstances, I recommend using the Tunnel method as much as possible. However, please configure the security policies such as DDoS and WAF provided by Cloudflare, because in this case, security relies solely on Cloudflare.
Below are the access speed test results of domain names using different website building methods, tested with webmaster tools, for your reference.
Test results of directly changing the origin server port to point to the domain name corresponding to the home broadband public IP using the method in this article:

Test results of the corresponding domain name using the Tunnel method to simulate website building with home broadband without a public IP:

The above two test results are actually about the same. Since the results vary each time, it is hard to compare which speed is faster. If you have the conditions, you can also test and compare them yourself.