Cloudflared - adding a second tunnel - how to point at multiple origins

As it’s saying, use your single tunnel to serve both domains if both of the origins/web servers are on the same machine.

If you’re using Dashboard managed tunnels (modifying settings in the Zero Trust dashboard), it’s as simple as adding a second Public Hostname to your existing tunnel, just specify the new subdomain and the different service, and done.

If you’re managing the configuration locally, use ingress rules: Ingress rules · Cloudflare Zero Trust docs
and perhaps consider switching to dashboard managed tunnels at some point, they’re a lot less manual to work with and easier overall.

ex. config:

tunnel: 6ff42ae2-765d-4adf-8112-31c55c1551ef
credentials-file: /root/.cloudflared/6ff42ae2-765d-4adf-8112-31c55c1551ef.json

  - hostname:
  - hostname:
  - service: http_status:404

Then just create the necessary DNS Records after. The tunnel can do this for you,
cloudflared tunnel route dns <tunnel name/id>

1 Like