Hello,
i'm using docker compose to setup a service. I need to define a middleware to strip a prefix from all the requests coming to the service. There will be other routers in the future with different hostnames that need to point to this service (that's why i'm trying to attach the middleware to the service and not to the router). This is my compose.yaml:
test:
image: ${TEST_IMAGE_URI}
container_name: test
restart: unless-stopped
env_file: .env-test
logging:
driver: journald
labels:
-
"traefik.enable=true"
-
"traefik.http.routers.test.rule=Host(`test.example.com`)"
-
"traefik.http.routers.test.entrypoints=websecure"
# Middleware to strip prefix
-
"traefik.http.middlewares.test-stripprefix.stripprefix.prefixes=/test"
-
"traefik.http.services.test.loadbalancer.server.port=3000"
-
"traefik.http.services.test.middlewares=test-stripprefix"
When i start the container I get this error in traefik logs: "ERR error="field not found, node: middlewares" container=test providerName=docker"
I'm following this documentation: Traefik HTTP Services Documentation - Traefik
I don't know what's happening