Deploying app on domain path using cloudflare tunnel

I was successfully able to expose the locally hosted chibisafe using the subdomain chibisafe.example.org
by setting the following in the cloudflared config

ingress:
  - hostname: chibisafe.example.org
    service: http://localhost:24424
  - service: http://192.168.0.103

**but now I want to host it on the main domain with path like **https://example.org/chibisafe

and I changed the cloudfalred config to

ingress:
  - hostname: example.org
    path: /chibisafe
    service: http://192.168.0.103:24424
  - service: http://192.168.0.103

but now I get 404 error, I was told that it is cloudflared issues
I was told not sure if cloudflare removes the /chibisafe path from the request once it proxies
But yeah basically you have to rewrite the request and remove /chibisafe before passing it to the chibi stack

I don’t know how to do this, any help would be greatly appreciated

This is correct. Cloudflared is going to server requests that are to https://example.org/chibisafe fromservice: http://192.168.0.103:24424 and then fallback to http://192.168.0.103.

Your best bet is running something like nginx that does the path rewriting.

I really don’t know how that can be done but I have apache2 server running, can it be done with it ?
if you can guide in the right direction then that would be great

Yes, Apache is capable of it. Check out something like

1 Like

only the 5th solution makes sense, but the solution seems to be for the subdomains.

My app chibisafe and others are running on docker container

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