When you create a tunnel and install it on your Cloudways server, it’ll automatically prompt you to add your public hostname e.g. myapp.domain.com which is bound locally on your server and working on e.g. HTTPS://localhost:8443. The DNS record, CNAME will be created automatically and proxied .
Otherwise, you’d get an error saying you already have a DNS record and you’d have to remove it. Therefrom, you can close open ports or setup simple UFW on your server to block anyone accessing over 8443 port (or some other to which your web app is bound) from outside. It’ll route and run through the tunnel. No need to expose it to the public Internet anymore while using a cloudflared tunnel, even if you’ve got a public static IP address.
Do you have SSL on the origin or not? If not, then you’ve got two options to fix a possible issue with this:
Make sure you’ve enabled noTLSVerify option for your public hostname on your configured cloudflared tunne and that your Website is bound to port 443 and “working” even with invalid SSL certificate over HTTPS at your local machine (not the best case)
Generate and install Cloudflare Origin CA certificate onto your Nginx web server on the local machine → Origin CA certificates · Cloudflare SSL/TLS docs (recommended to solve your issues with errors you’re experiencing and to have end-to-end encryption)
So I would set up SSL on the proxy server? The tunnel I plan to set up pointing to the website on an VPS server by another corp. I plan to have the proxy (on its own server) point to the tunnel that points to the web server VPS