Enable tunnel to multiple services

Hi,

I have been trying to setup remote access to two services running on a server

  1. hello_world application
  2. ssh over the browser (using the Cloudflare Zero Trust application - tutorial here)

I have successfully setup then tunnel and able to access both the services individually over example.domain.com. I have been now trying to merge the two access together over different paths

  1. hello_world → example.domain.com/hello
  2. ssh → example.domain.com/ssh

I have following sample yml file in place

tunnel: <tunnel_id>
credentials-file: /root/.cloudflared/<tunnel_id>.json
logfile: /var/log/cloudflared.log

ingress:
  - hostname: example.domain.com
    service: hello_world
    path: /hello
  - hostname: example.domain.com
    service: ssh://localhost:22
    path: /ssh
  - service: http_status:404

Unfortunately, it is not working as expected. Any help would be greatly appreciated.

  1. Hello World is working fine
  2. SSH rendering on the browser is failing with the following error
[Error] Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (ssh, line 0)

I guess this is intentional. The path is passed to the target, so “example.domain.com/ssh” will proxy to “localhost:22/ssh” (should not work for ssh).
With a webserver (your “hello_world” app?) this becomes clearer, because the actual path on the target webserver has to exists for it to work.