Using Cloudflare CDN
TIP
Before reading this section, please fully understand the 「Network Architecture」 and 「HTTPS Reverse Proxy」 chapters.
This section is intended for users of Cloudflare CDN.
This section explains how to access the daemon from the panel while using Cloudflare as a proxy.
Note that Cloudflare only serves as a CDN and does NOT provide port conversion services. That is, the port Cloudflare uses to access the source server is the SAME as the port users use to access Cloudflare.
If you want multiple daemons to share one public port, consider using different subdomains and configure Nginx to forward differently based on the domain.
WARNING
Cloudflare only support the following HTTPS ports:
- 443
- 2053
- 2083
- 2087
- 2096
- 8443
Please choose one of the above ports as the external HTTPS port.
1. Configure DNS
- Log in to the Cloudflare console and open the sub-panel for your domain.
- In the
DNSsubmenu in the sidebar, findRecords, and add a newAorCNAMErecord pointing to your host. - Ensure
Proxy Statusis set toDNS onlyat this moment and save.
2. Configure HTTPS Reverse Proxy
Before configuring Cloudflare CDN, (if not already) follow the 「HTTPS Reverse Proxy」 section and enable HTTPS for your panel and daemon(s) using one of the ports mentioned above. You can use a self-signed or Cloudflare's SSL certificate.
Please make sure you can connect via a browser using the domain configured before continue.
Using Cloudflare's Certificate:
- Open the Cloudflare panel and the sub-panel for your domain.
- In the
SSL/TLSsubmenu, find theOrigin Serveroption and open it. - Click
create certificate, and choose private key type, domain, and validity period (recommended:ECCprivate key type, keep domaindefault, and select15 yearsvalidity). - Copy and save the certificate and key.
Using a Self-Signed Certificate:
#Generate a Self-Signed Certificate using OpenSSL
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3653. Configure Cloudflare
Open the Cloudflare panel and the sub-panel for your domain, and open the SSL/TLS menu.
- If you're using a
self-signed certificate, change the SSL/TLSencryption modetoFull. - If you're using a Cloudflare certificate, you can choose between
StrictorFull. In general,Fullis sufficient formostusers.
In the DNS submenu, find Records.
- Edit the
AorCNAMErecord you just added. - Change
Proxy StatustoProxiedand save.
4. Test Access
Using the domain configured in step two, test access again with your browser.
If it displays correctly, congratulations! You have successfully enabled Cloudflare for your panel and/or node!
Now, you can add nodes to your panel following the steps in the 「HTTPS Reverse Proxy」 section.
If the test fails, you may need to manually clear the DNS cache and retry.
