cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛 Public Hostnames "Path" is appended to Service URL

Open michaelweinold opened this issue 1 year ago • 1 comments

Opening this as a cloudflared issue at the suggestion of @ranbel. See also: https://github.com/cloudflare/cloudflare-docs/issues/7264

Describe the bug

The Public Hostname Page for a Cloudflare Tunnel has three fields:

(optional) Subdomain (required) Domain (optional) Path

As the documentation clearly states, this can be used to expose http resources like so:

subdomain.domain.com >> http://localhost:1234

However, it seems that the beheviour is currently such that instead of:

subdomain.domain.com/path1 >> http://localhost:1234
subdomain.domain.com/path2 >> http://localhost:5678

we get:

subdomain.domain.com/path1 >> http://localhost:1234/path1
subdomain.domain.com/path1 >> http://localhost:1234/path2

To Reproduce Steps to reproduce the behavior:

  1. Follow the Cloudflared documentation to expose any HTTP resources to the Internet via a public hostname.

Expected behavior

subdomain.domain.com/path1 >> http://localhost:1234
subdomain.domain.com/path2 >> http://localhost:5678

Environment and versions

Logs and errors N/A

Additional context N/A

michaelweinold avatar Jul 19 '23 20:07 michaelweinold

This is very cumbersome - we may put a component rewriting the path in front of service, but it would be ideal if cloudflared can do this. This would be a breaking change so probably needs a config at each public hostname level.

chulkilee avatar Feb 15 '24 23:02 chulkilee