Issue with exposing swarm service with a certain domain path

Hi,
I am a quite "new" traefik user and for training purposes, I'm trying to expose my swarm service (services in future but now I cannot deal even with one :smiley:).
So, from the beginning:

  • Take a look at my problematic swarm service definition:
version: "3.7"
services:
  vote:
    image: vote
    networks:
      - frontend
      - proxy
    depends_on:
      - redis
    deploy:
      replicas: 1
      update_config:
        parallelism: 2
      restart_policy:
        condition: on-failure
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.vote.service=vote"
        - "traefik.http.routers.vote.rule=Host(`my.domain`) && Path(`/vote`)"
        - "traefik.http.routers.vote.entrypoints=web"
        - "traefik.http.services.vote.loadbalancer.server.port=80"
        - "traefik.docker.network=proxy"
networks:
  frontend:
  proxy:
    external: true

I am deploying it using docker swarm stack (because there are also other services but it is not important right now).

  • Traefik stack definition:
version: "3.3"

services:
  traefik:
    image: "traefik:v2.6"
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.swarmMode=true"
      - "--entryPoints.web.address=:80"
    deploy:
      labels:
        - "traefik.enable=true"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
      - proxy

networks:
  proxy:
    external: true

To sum up:
I want to get a response from the exposed service when I go to: "my.domain/vote" but I'm receiving a 404 - The requested URL was not found on the server.

But when I only remove the Path(/vote) (or PathPrefix(/vote) - I tried both) and let my service be reachable directly from my.domain without path everything is working properly.
Can someone help me / point out where I am doing something wrong? I'll be really grateful!
Below I am attaching a full logfile from traefik service.

traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="Configuration loaded from flags."
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="Traefik version 2.6.3 built on 2022-03-29T13:09:27Z"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"udp\":{\"timeout\":\"3s\"}},\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"swarmMode\":true,\"swarmModeRefreshSeconds\":\"15s\"}},\"api\":{\"insecure\":true,\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"},\"pilot\":{\"dashboard\":true}}"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://doc.traefik.io/traefik/contributing/data-collection/\n"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="Starting provider aggregator.ProviderAggregator"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Start TCP Server" entryPointName=web
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Start TCP Server" entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="Starting provider *traefik.Provider"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="*traefik.Provider provider configuration: {}"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Configuration received from provider internal: {\"http\":{\"routers\":{\"api\":{\"entryPoints\":[\"traefik\"],\"service\":\"api@internal\",\"rule\":\"PathPrefix(`/api`)\",\"priority\":2147483646},\"dashboard\":{\"entryPoints\":[\"traefik\"],\"middlewares\":[\"dashboard_redirect@internal\",\"dashboard_stripprefix@internal\"],\"service\":\"dashboard@internal\",\"rule\":\"PathPrefix(`/`)\",\"priority\":2147483645}},\"services\":{\"api\":{},\"dashboard\":{},\"noop\":{}},\"middlewares\":{\"dashboard_redirect\":{\"redirectRegex\":{\"regex\":\"^(http:\\\\/\\\\/(\\\\[[\\\\w:.]+\\\\]|[\\\\w\\\\._-]+)(:\\\\d+)?)\\\\/$\",\"replacement\":\"${1}/dashboard/\",\"permanent\":true}},\"dashboard_stripprefix\":{\"stripPrefix\":{\"prefixes\":[\"/dashboard/\",\"/dashboard\"]}}},\"serversTransports\":{\"default\":{\"maxIdleConnsPerHost\":200}}},\"tcp\":{},\"tls\":{}}" providerName=internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="Starting provider *docker.Provider"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="*docker.Provider provider configuration: {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"swarmMode\":true,\"swarmModeRefreshSeconds\":\"15s\"}"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=info msg="Starting provider *acme.ChallengeTLSALPN"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="*acme.ChallengeTLSALPN provider configuration: {\"Timeout\":4000000000}"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="No default certificate, generating one" tlsStoreName=default
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Provider connection established with docker 20.10.12 (API 1.41)" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Added outgoing tracing middleware api@internal" routerName=api@internal middlewareName=tracing middlewareType=TracingForwarder entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Added outgoing tracing middleware dashboard@internal" routerName=dashboard@internal middlewareName=tracing middlewareType=TracingForwarder entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Creating middleware" entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_stripprefix@internal middlewareType=StripPrefix
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Adding tracing to middleware" middlewareName=dashboard_stripprefix@internal entryPointName=traefik routerName=dashboard@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Creating middleware" routerName=dashboard@internal middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/" routerName=dashboard@internal middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Adding tracing to middleware" entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_redirect@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Creating middleware" entryPointName=traefik middlewareName=traefik-internal-recovery middlewareType=Recovery
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="No default certificate, generating one" tlsStoreName=default
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Added outgoing tracing middleware dashboard@internal" middlewareType=TracingForwarder routerName=dashboard@internal entryPointName=traefik middlewareName=tracing
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Creating middleware" entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_stripprefix@internal middlewareType=StripPrefix
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Adding tracing to middleware" routerName=dashboard@internal middlewareName=dashboard_stripprefix@internal entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Creating middleware" middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex entryPointName=traefik routerName=dashboard@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/" middlewareType=RedirectRegex entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_redirect@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Adding tracing to middleware" middlewareName=dashboard_redirect@internal entryPointName=traefik routerName=dashboard@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Added outgoing tracing middleware api@internal" routerName=api@internal entryPointName=traefik middlewareName=tracing middlewareType=TracingForwarder
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:32:46Z" level=debug msg="Creating middleware" entryPointName=traefik middlewareName=traefik-internal-recovery middlewareType=Recovery
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:01Z" level=error msg="service \"traefik-traefik\" error: port is missing" providerName=docker container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:01Z" level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:01Z" level=debug msg="Skipping same configuration" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:16Z" level=error msg="service \"traefik-traefik\" error: port is missing" container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:16Z" level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:16Z" level=debug msg="Skipping same configuration" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=error msg="service \"traefik-traefik\" error: port is missing" providerName=docker container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=error msg="service \"app-worker\" error: port is missing" providerName=docker container=app-worker-ppxgkywa1gbwaknhtbl0usbgr
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=error msg="service \"app-db\" error: port is missing" container=app-db-o7ohdcwpvm5zykfmn4g018r66 providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=error msg="service \"app-result\" error: port is missing" providerName=docker container=app-result-pkoq71uodwmx2itun7gce79al
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=error msg="service \"app-redis\" error: port is missing" providerName=docker container=app-redis-l27uzxriltpm3f9yghqohclig
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"vote\":{\"entryPoints\":[\"web\"],\"service\":\"vote\",\"rule\":\"Host(`promvm1.westeurope.cloudapp.azure.com`) \\u0026\\u0026 Path(`/vote`)\"}},\"services\":{\"vote\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.7.122:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="No default certificate, generating one" tlsStoreName=default
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating middleware" middlewareType=Pipelining entryPointName=web routerName=vote@docker serviceName=vote middlewareName=pipelining
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating load-balancer" entryPointName=web routerName=vote@docker serviceName=vote
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating server 0 http://10.0.7.122:80" serviceName=vote serverName=0 entryPointName=web routerName=vote@docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="child http://10.0.7.122:80 now UP"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Propagating new UP status"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Added outgoing tracing middleware vote" routerName=vote@docker entryPointName=web middlewareName=tracing middlewareType=TracingForwarder
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating middleware" middlewareType=Recovery entryPointName=web middlewareName=traefik-internal-recovery
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Added outgoing tracing middleware api@internal" middlewareName=tracing middlewareType=TracingForwarder entryPointName=traefik routerName=api@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Added outgoing tracing middleware dashboard@internal" routerName=dashboard@internal middlewareName=tracing middlewareType=TracingForwarder entryPointName=traefik
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating middleware" middlewareType=StripPrefix entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_stripprefix@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Adding tracing to middleware" middlewareName=dashboard_stripprefix@internal entryPointName=traefik routerName=dashboard@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating middleware" entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/" entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Adding tracing to middleware" entryPointName=traefik routerName=dashboard@internal middlewareName=dashboard_redirect@internal
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:31Z" level=debug msg="Creating middleware" middlewareType=Recovery entryPointName=traefik middlewareName=traefik-internal-recovery
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:33Z" level=debug msg="vulcand/oxy/roundrobin/rr: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/vote\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Accept-Language\":[\"en-US,en;q=0.9\"],\"Connection\":[\"keep-alive\"],\"Cookie\":[\"grafana_session=c3019e2bbc062d434ad7cee0ce3dc485; voter_id=52fc57ddd6a670a8; io=Wmfg0Gn03fzdBJ-8AAAB\"],\"Upgrade-Insecure-Requests\":[\"1\"],\"User-Agent\":[\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\"],\"X-Forwarded-Host\":[\"promvm1.westeurope.cloudapp.azure.com\"],\"X-Forwarded-Port\":[\"80\"],\"X-Forwarded-Proto\":[\"http\"],\"X-Forwarded-Server\":[\"286ae7c8e950\"],\"X-Real-Ip\":[\"10.0.0.2\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"promvm1.westeurope.cloudapp.azure.com\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"10.0.0.2:1257\",\"RequestURI\":\"/vote\",\"TLS\":null}"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:33Z" level=debug msg="vulcand/oxy/roundrobin/rr: Forwarding this request to URL" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/vote\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Accept-Language\":[\"en-US,en;q=0.9\"],\"Connection\":[\"keep-alive\"],\"Cookie\":[\"grafana_session=c3019e2bbc062d434ad7cee0ce3dc485; voter_id=52fc57ddd6a670a8; io=Wmfg0Gn03fzdBJ-8AAAB\"],\"Upgrade-Insecure-Requests\":[\"1\"],\"User-Agent\":[\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\"],\"X-Forwarded-Host\":[\"promvm1.westeurope.cloudapp.azure.com\"],\"X-Forwarded-Port\":[\"80\"],\"X-Forwarded-Proto\":[\"http\"],\"X-Forwarded-Server\":[\"286ae7c8e950\"],\"X-Real-Ip\":[\"10.0.0.2\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"promvm1.westeurope.cloudapp.azure.com\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"10.0.0.2:1257\",\"RequestURI\":\"/vote\",\"TLS\":null}" ForwardURL="http://10.0.7.122:80"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:33Z" level=debug msg="vulcand/oxy/roundrobin/rr: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/vote\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Accept-Language\":[\"en-US,en;q=0.9\"],\"Connection\":[\"keep-alive\"],\"Cookie\":[\"grafana_session=c3019e2bbc062d434ad7cee0ce3dc485; voter_id=52fc57ddd6a670a8; io=Wmfg0Gn03fzdBJ-8AAAB\"],\"Upgrade-Insecure-Requests\":[\"1\"],\"User-Agent\":[\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\"],\"X-Forwarded-Host\":[\"promvm1.westeurope.cloudapp.azure.com\"],\"X-Forwarded-Port\":[\"80\"],\"X-Forwarded-Proto\":[\"http\"],\"X-Forwarded-Server\":[\"286ae7c8e950\"],\"X-Real-Ip\":[\"10.0.0.2\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"promvm1.westeurope.cloudapp.azure.com\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"10.0.0.2:1257\",\"RequestURI\":\"/vote\",\"TLS\":null}"
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=error msg="service \"traefik-traefik\" error: port is missing" providerName=docker container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=error msg="service \"app-worker\" error: port is missing" container=app-worker-ppxgkywa1gbwaknhtbl0usbgr providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=error msg="service \"app-db\" error: port is missing" providerName=docker container=app-db-o7ohdcwpvm5zykfmn4g018r66
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=error msg="service \"app-result\" error: port is missing" providerName=docker container=app-result-pkoq71uodwmx2itun7gce79al
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=error msg="service \"app-redis\" error: port is missing" providerName=docker container=app-redis-l27uzxriltpm3f9yghqohclig
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"vote\":{\"entryPoints\":[\"web\"],\"service\":\"vote\",\"rule\":\"Host(`promvm1.westeurope.cloudapp.azure.com`) \\u0026\\u0026 Path(`/vote`)\"}},\"services\":{\"vote\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.7.122:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:33:46Z" level=debug msg="Skipping same configuration" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=error msg="service \"traefik-traefik\" error: port is missing" container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=error msg="service \"app-worker\" error: port is missing" container=app-worker-ppxgkywa1gbwaknhtbl0usbgr providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=error msg="service \"app-db\" error: port is missing" container=app-db-o7ohdcwpvm5zykfmn4g018r66 providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=error msg="service \"app-result\" error: port is missing" container=app-result-pkoq71uodwmx2itun7gce79al providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=error msg="service \"app-redis\" error: port is missing" providerName=docker container=app-redis-l27uzxriltpm3f9yghqohclig
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"vote\":{\"entryPoints\":[\"web\"],\"service\":\"vote\",\"rule\":\"Host(`promvm1.westeurope.cloudapp.azure.com`) \\u0026\\u0026 Path(`/vote`)\"}},\"services\":{\"vote\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.7.122:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:01Z" level=debug msg="Skipping same configuration" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=error msg="service \"traefik-traefik\" error: port is missing" providerName=docker container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=error msg="service \"app-worker\" error: port is missing" providerName=docker container=app-worker-ppxgkywa1gbwaknhtbl0usbgr
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=error msg="service \"app-db\" error: port is missing" providerName=docker container=app-db-o7ohdcwpvm5zykfmn4g018r66
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=error msg="service \"app-result\" error: port is missing" providerName=docker container=app-result-pkoq71uodwmx2itun7gce79al
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=error msg="service \"app-redis\" error: port is missing" container=app-redis-l27uzxriltpm3f9yghqohclig providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"vote\":{\"entryPoints\":[\"web\"],\"service\":\"vote\",\"rule\":\"Host(`promvm1.westeurope.cloudapp.azure.com`) \\u0026\\u0026 Path(`/vote`)\"}},\"services\":{\"vote\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.7.122:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:16Z" level=debug msg="Skipping same configuration" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=error msg="service \"traefik-traefik\" error: port is missing" providerName=docker container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=error msg="service \"app-worker\" error: port is missing" providerName=docker container=app-worker-ppxgkywa1gbwaknhtbl0usbgr
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=error msg="service \"app-db\" error: port is missing" providerName=docker container=app-db-o7ohdcwpvm5zykfmn4g018r66
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=error msg="service \"app-result\" error: port is missing" container=app-result-pkoq71uodwmx2itun7gce79al providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=error msg="service \"app-redis\" error: port is missing" container=app-redis-l27uzxriltpm3f9yghqohclig providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"vote\":{\"entryPoints\":[\"web\"],\"service\":\"vote\",\"rule\":\"Host(`promvm1.westeurope.cloudapp.azure.com`) \\u0026\\u0026 Path(`/vote`)\"}},\"services\":{\"vote\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.7.122:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:31Z" level=debug msg="Skipping same configuration" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=error msg="service \"traefik-traefik\" error: port is missing" providerName=docker container=traefik-traefik-pi4wpwsa3s272hfe8bbty97ui
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=error msg="service \"app-worker\" error: port is missing" providerName=docker container=app-worker-ppxgkywa1gbwaknhtbl0usbgr
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=error msg="service \"app-db\" error: port is missing" container=app-db-o7ohdcwpvm5zykfmn4g018r66 providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=error msg="service \"app-result\" error: port is missing" providerName=docker container=app-result-pkoq71uodwmx2itun7gce79al
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=error msg="service \"app-redis\" error: port is missing" container=app-redis-l27uzxriltpm3f9yghqohclig providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"vote\":{\"entryPoints\":[\"web\"],\"service\":\"vote\",\"rule\":\"Host(`promvm1.westeurope.cloudapp.azure.com`) \\u0026\\u0026 Path(`/vote`)\"}},\"services\":{\"vote\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.7.122:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
traefik_traefik.1.pi4wpwsa3s27@prometheus-vm1    | time="2022-04-28T09:34:46Z" level=debug msg="Skipping same configuration" providerName=docker```

Maybe I have a wrong understanding of how Path / PathPrefix working.
All I need to do is route a path after my domain name to certain service, in example:

  • my.domain/monitoring -> swarm monitoring service
  • my.domain/other -> swarm else service.

Thanks in advance!

At a guess your service is not able to handle the /vote path. Using a stripprefix middleware may work.
Some apps require (re)configuration to work with a pathprefix.

@cakiwi I've tried to use stripprefix according to your advice - it is working only in a half - I'm able to reach my service on a specific path but in a browser, it seems like the only file that is loaded properly is index.html - rest of the files (* .js and * .css) returns "404 not found" errors.

Tested service definition:

version: "3.7"
services:
  result:
    image: result
    networks:
      - backend
      - proxy
    depends_on:
      - db
    deploy:
      replicas: 1
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.result.service=result"
        - "traefik.http.routers.result.rule=Host(`my.domain`) && PathPrefix(`/result`)"
        - "traefik.http.middlewares.result-strip.stripprefix.prefixes=/result"
        - "traefik.http.middlewares.result-strip.stripprefix.forceSlash=false"
        - "traefik.http.routers.result.entrypoints=web"
        - "traefik.http.services.result.loadbalancer.server.port=80"
        - "traefik.docker.network=proxy"
        - "traefik.http.routers.result.middlewares=result-strip@docker"
networks:
  backend:
  proxy:
    external: true

What can i see in browser (HTML index file only I guess):
browser_output

Browser's devtools logs:

Any ideas what can be the reason for this issue? Is the problem again related to the service's implementation? I thought that the stripprefix should solve it. Thanks in advance again! :slight_smile: