Redirect path to service outsite docker

Hello traefik community,

I'm currently struggling to get a local installed service working together with my docker services.
I have running multiple services on the sub path /app1 and /app2, now I want to set to /app3 an app outside from docker that's currently running under https://[my-ip]:9090.
The app3 is cockpit that can't run under docker.
What I'm getting is only a 404 page not found, like https://[my-ip]/cockpit isn't existing.

Can I achieve this also with the new label config style in the docker compose, but keep in mind this question counts only if we get it previously working?

File: docker-compose.yml

version: '3.7'
    restart: always
    image: traefik:v2.3.2
      - "80:80"
      - "443:443"
      - "8080:8080"
      - traefik01
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik/traefik.log:/var/log/traefik.log
      - ./traefik/traefik.toml:/traefik.toml
      - ./traefik/traefik_dynamic.toml:/traefik_dynamic.toml
      - ./traefik/acme.json:/acme.json

    driver: bridge

File: traefik.toml

  level = "DEBUG"
  filePath = "/var/log/traefik.log"

    address = ":80"
      to = "websecure"
      scheme = "https"

    address = ":443"

  debug = true
  dashboard = true
  insecure = true

  email = ""
  storage = "acme.json"
  caServer = ""

  watch = true
  network = "traefik01"

  filename = "traefik_dynamic.toml"

FIle: traefik_dynamic.toml

# http routing section
    # Define a connection between requests and services
      rule = "PathPrefix(`/cockpit{regex:$$|/.*}`)"
      middlewares = ["cockpit-stripprefix"]
      # If the rule matches, forward to the cockpit service (declared below)
      service = "cockpit"
          certResolver = "lets-encrypt"
      service = "api@internal"
          certResolver = "lets-encrypt"

    prefixes = ["/cockpit"]

    # Define how to reach an existing service on our infrastructure
        url = "http://<my-ip>:9090/"

Nobody has a answer for my question?

I think your pathprefix is the cause. To be sure if have traefik access logs you can see what router(if any) is handling the request.

Have your tried just PathPrefix(`/cockpit`) or PathPrefix(`/cockpit/`)

1 Like

I tried it already.
But I need all sub paths redirected to the app is this wrong?

That is what PathPrefix() will do. Otherwise you would use Path()

1 Like

You sir, are my hero for today. Thanks for those responses!

1 Like