Traefik path proxy to custom url

Hi there,

I'm new to Traefik and i'm having a bit of a problem here. I have a webserver with only one domain (actually none, only ip address, but it will have one domain). I need to route paths to custom services, for example:

I need the /frontend path to route to docker_container_frontend:3000.
I need the /backend path to route to docker_container_backend:8000.

The thing is. When i access the /backend path, it should call the backend container at port 8000, but with the custom url /admin, like:

http://myserver/backend/useradmin -> http://backend_container:8000/admin/useradmin

it should parse everything that's infront of backend/ and send to the container after the /admin/

Is that possible?

The request is the easy part, you can use middleware to adjust the path.

The hard part is the response. If you run a GUI, it will usually respond with a fixed absolute path for links, redirects, images and scripts.

That’s why for GUI applications usually a sub-domain is used, so it can run on /.

Plain API is usually not a problem.

that's already being considered, we're thinking how we can do that. Maybe make the GUI reply all the time with relative links. The middleware part i have no idea how to perform.

For using a different path for routing, the web app should support setting a "base path". If not, go with sub- domain.

Check ReplacePath and ReplacePathRegex middlewares (doc).