Cloudflare tunnels and reverse proxy

What is the name of the domain?

Taerel dot com

What is the error number?

N/A

What is the error message?

N/A

What is the issue you’re encountering

How to set up proxy → tunnel → server

What steps have you taken to resolve the issue?

How would I set up cloudflare tunnels to go Cloudways server + cloudflare add on (set up as a proxy) → cloudflare tunnel → web server?

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 :orange: .

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:

  1. 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)

  1. 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)

Nevertheless, go here https://dash.cloudflare.com/?to=/:account/:zone/ssl-tls/configuration. Select Custom and not automatic. Reference, Introducing Automatic SSL/TLS: securing and simplifying origin connectivity. Double-check your SSL/TLS setting to make sure it’s set to Full (Strict).

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

Sounds a bit complicated at first sight :thinking:
Host A → Host B proxy and the cloudflared tunnel will be on Host A? :thinking:

SSL termination on your proxy has to be done correctly, otherwise I’d expect some errors with the connection at first.

Host A (proxy) → host B cloudflare tunnel + website

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.