How to strip subpath from cloudflared tunnel end point?

Hello there, I wondered if any of you clever people knew how to do this? I couldn't find anything more about working with the end "Path" in the docs. Is there a command line switch for tunnelor something? Requests to my end point on its subpath, get forwarded to services on my server including the subpath ("ribbydibby"):
fastapi | INFO 172.18.0.3:40024 - "GET /ribbydibby HTTP/1.1" 404
fastapi | INFO 172.18.0.3:38406 - "GET /ribbydibby/ HTTP/1.1" 404
fastapi | INFO 172.18.0.3:45704 - "GET /ribbydibby/docs HTTP/1.1" 404
fastapi | INFO 172.18.0.3:45234 - "GET /ribbydibby/robots.txt HTTP/1.1" 404
fastapi | INFO 172.18.0.3:40024 - "GET /ribbydibby HTTP/1.1" 404
fastapi | INFO 172.18.0.3:38406 - "GET /ribbydibby/ HTTP/1.1" 404
fastapi | INFO 172.18.0.3:45704 - "GET /ribbydibby/docs HTTP/1.1" 404
fastapi | INFO 172.18.0.3:45234 - "GET /ribbydibby/robots.txt HTTP/1.1" 404
No description
3 Replies
Razboy20
Razboy204mo ago
Might not be a way to strip it on cloudflares end currently, but you could put a reverse proxy in between your app and the tunnel which strips the path
Razboy20
Razboy204mo ago
Caddy Community
Remove path prefix on reverse_proxy
1. Caddy version (caddy version): v2.4.6 2. How I run Caddy: caddy start a. System environment: debian OS d. My complete Caddyfile or JSON config: test.example.com { reverse_proxy /api/* localhost:9000 } 3. The problem I’m having: I want to remove the path api from uri A call to https://test.example.com/api/__health will need to pr...
JamesParrott
JamesParrottOP4mo ago
Good shout. Caddy, and many routing work arounds on my end are possible too. One of my reasons for using cloudflared in the first place though, was so that I could drop Caddy. Thanks though.

Did you find this page helpful?