Service with path

Hi there,

I am trying to achieve the following:

Say I have a domain: my-domain.com.
I also have a service which is serve'ing a stream: http://stream-endpoint:8080/stream.mp3
What I want is that when I go to http://my-domain.com, I get the stream.mp3.

This is the setup I currently have:

http:
  services:
    streaming-endpoint:
      loadBalancer:
        servers:
          - url: "http://streaming-endpoint:8080/radio.mp3"

routers:
  my-domain:
    rule: "Host(`my-domain.com`)"
    service: streaming-endpoint

However, this does not seem to work. Does anyone have a tip to help? Much appreciated!

Hi Thijmen

Yeah, it's not gonna work that way. What should work is to use a middleware with a rewrite in between, i.e. a classic redirect "/ -> /stream.mp3".

Here's a good example: https://docs.traefik.io/middlewares/redirectregex/

Your service should then only contain the URL and the port and configure the middleware in the router accordingly. Maybe you could try this.