Good morning, I'm using Traefik in a Docker environment with a Django backend. The issue I'm facing is that when I enter a URL like localhost/service/test/
, I get a 200 response and everything works fine. However, when I enter localhost/service/test
(without the trailing slash), I receive a 301 redirect and Traefik redirects me to localhost/test/
. How can I maintain the prefix? Below is my app configuration:
deploy:
labels:
- "traefik.enable=true"
- "traefik.constraint-label=cloud-public"
- "traefik.http.services.service.loadbalancer.server.port=8000"
- "traefik.http.routers.service.entrypoints=web"
- "traefik.http.routers.service.rule=PathPrefix(`/service`)"
- "traefik.http.routers.service.middlewares=service-stripprefix"
- "traefik.http.routers.service.tls=false"
- "traefik.http.middlewares.service-stripprefix.stripprefix.prefixes=/service,/service/"
database:
Thank you!