Owncloud on subpath behind traefik 2.x: stuck login after redirect_url is added to the url

I am running owncloud (v10.10) via docker + traefik (v2.6) on a subpath, i.e. <myurl>/owncloud.

Access via local network works just fine but when trying to access via <myurl>/owncloud I am stuck at the login screen.

Entering <myurl>/owncloud puts me to <myurl>/owncloud/login, after entering the correct user and password I get redirected to <myurl>/owncloud/login?redirect_url=%252Fowncloud%252Fapps%252Ffiles%252F and stay stuck on the login page even though I entered the correct user and password. This does not happen when accessing via my local network.

Here are the (relevant) owncloud settings:

      - ${HTTP_PORT}:8080
      - OWNCLOUD_SUB_URL=/owncloud
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=owncloud
      - OWNCLOUD_DB_HOST=mariadb
      - traefik_proxy
      - internal
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_proxy"
      - "traefik.http.routers.owncloud-frontend.entrypoints=websecure"
      - "traefik.http.routers.owncloud-frontend.service=owncloud"
      - "traefik.http.services.owncloud.loadbalancer.server.port=8080"
      - "traefik.http.routers.owncloud-frontend.rule=Host(`<myurl>`) && PathPrefix(`/owncloud`)"

Note, I played around with various different traefik middlewares like addprefix, redirectregex, replacepathregex, stripprefix but without the desired result of properly logging in to owncloud.

The hint for the OWNCLOUD_SUB_URL is from https://github.com/owncloud-docker/base/issues/38.
I am also aware of @lefherz article https://central.owncloud.org/t/docker-how-to-set-up-owncloud-with-traefik-for-let-s-encrypt-ssl/15446 but unfortunately it is fairly outdated (i.e. use of traefik v1) and does not cover suburls.

I am out of ideas so an hints / comments are highly appreciated.
I am also happy to post more information like logs / traefik setup and so on if required.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.