-1

Im trying add traefik to add sentry in docker swarm stack but i have wrong redirection: mydomain.com/auth/login/ instead of mydomain.com/apps/sentry/auth/login/

My traefik config:

[entryPoints]
  [entryPoints.http]
    address = ":80"
    [entryPoints.http.redirect]
      entryPoint = "https"
  [entryPoints.https]
    address = ":443"
    [entryPoints.https.tls]
    [[entryPoints.https.tls.certificates]]
      certFile = "/run/secrets/cf_pub.pem"
      keyFile = "/run/secrets/cf_priv.pem"

My configuration in stack:

- "traefik.docker.network=traefik"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:mydomain.com;PathPrefixStrip:/apps/sentry/"
- "traefik.frontend.entryPoints=https,http"
- "traefik.port=9000"
- "traefik.domain=mydomain.com"

In sentry cant change root url.

ldez
  • 3,030
  • 19
  • 22
rafal1337
  • 164
  • 10

1 Answers1

0

Use PathPrefix instead of PathPrefixStrip

PathPrefixStrip: Match request prefix path and strip off the path prefix prior to forwarding the request to the backend. It accepts a sequence of literal prefix paths. Starting with Traefik 1.3, the stripped prefix path will be available in the X-Forwarded-Prefix header.

.

PathPrefix: Match request prefix path. It accepts a sequence of literal and regular expression prefix paths.

https://docs.traefik.io/v1.7/basics/#matchers

ldez
  • 3,030
  • 19
  • 22