Middleware to add the “/” if needed

Hi there,

here are some minor additions regarding the topic "Middleware to add the “/” if needed" (Middleware to add the "/" if needed). The original topic has been closed already, that is why I open a new one:

The regexes should also contain hyphens, and not only alphanumeric characters and underscores.

- traefik.http.middlewares.strip-prefix.chain.middlewares=strip-prefix-1,strip-prefix-2
- traefik.http.middlewares.strip-prefix-1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_-]+)$$
- traefik.http.middlewares.strip-prefix-1.redirectregex.replacement=$${1}/
- traefik.http.middlewares.strip-prefix-1.redirectregex.permanent=true
- traefik.http.middlewares.strip-prefix-2.stripprefixregex.regex=/[a-z0-9_-]+
# and don't forget to add the middleware to your router
- traefik.http.routers.your-routers-name.middlewares=strip-prefix@docker"
1 Like