Traefik + Vikunja getting error {"message":"Not Found"}

Hello, I have been trying to setup vikunja and I have been running into some errors I setup vikunja using Full docker example | Vikunja because I looked at Full docker example | Vikunja however I have a very custom traefik config and I want anything with traefik in 1 docker-compose file. Here is my vikunja config -

version: '3'

services:
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1000
    environment:
      MYSQL_ROOT_PASSWORD: mypassword
      MYSQL_USER: connor
      MYSQL_PASSWORD: mypassword
      MYSQL_DATABASE: vikunja
    volumes:
      - ./db:/var/lib/mysql
    restart: unless-stopped
  api:
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: password
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: connor
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: secret
      VIKUNJA_SERVICE_ENABLEREGISTRATION: "true"
      VIKUNJA_SERVICE_FRONTENDURL: https://vikunja.mywebsite.com/
    ports:
      - 3456:3456
    volumes:
      - ./files:/app/vikunja/files
    depends_on:
      - db
    restart: unless-stopped
  frontend:
    image: vikunja/frontend
    ports:
      - 90:80
    environment:
      VIKUNJA_API_URL: https://vikunja.silvsam.com/api/v1
    restart: unless-stopped

here is the part of my traefik config that matters

    volumes:
      - $DOCKERDIR/traefik2/rules/cloudserver:/rules # file provider directory
      - /var/run/docker.sock:/var/run/docker.sock:ro # If you use Docker Socket Proxy, comment this line out
      - $DOCKERDIR/traefik2/acme/acme.json:/acme.json # cert location - you must create this empty file and change permissions to 600
      # - $DOCKERDIR/shared:/shared
    labels:
      - "traefik.enable=true"
      # HTTP Routers
      - "traefik.http.routers.traefik-rtr.entrypoints=https"
      - "traefik.http.routers.traefik-rtr.rule=Host(`traefik.$DOMAINNAME_CLOUD_SERVER`)"
      - "traefik.http.routers.vikunja-frontend-laptop-svc.rule=Host(`vikunja.silvsam.com`) && (PathPrefix(`/api/v1`) || PathPrefix(`/dav/`) || PathPrefix(`/.well-known/`))"
      # - "traefik.http.routers.traefik-rtr.tls=true" # Some people had 404s without this
      # - "traefik.http.routers.traefik-rtr.tls.certresolver=dns-cloudflare" # Comment out this line after first run of traefik to force the use of wildcard certs
      - "traefik.http.routers.traefik-rtr.tls.domains[0].main=$DOMAINNAME_CLOUD_SERVER"
      - "traefik.http.routers.traefik-rtr.tls.domains[0].sans=*.$DOMAINNAME_CLOUD_SERVER"
      ## Services - API
      - "traefik.http.routers.traefik-rtr.service=api@internal"
      - "traefik.http.routers.traggo-laptop-svc=api@internal"
      - "traefik.http.routers.vikunja-frontend-laptop-svc=api@internal"
      - "traefik.http.routers.vikunja-laptop-svc=api@internal"
      - "traefik.http.routers.portainer-laptop-svc=api@internal"
      - "traefik.http.routers.nginx-rpi-svc=api@internal"
      - "traefik.http.routers.nginx-laptop-svc=api@internal"
      ## Middlewares
      - "traefik.http.routers.traefik-rtr.middlewares=chain-no-auth@file"

here is vikunja svc file -

http:
  routers:
    vikunja-laptop-svc:
      rule: "Host(`vikunja.{{env "DOMAINNAME_CLOUD_SERVER"}}`)"
      entryPoints:
        - https
      middlewares:
        - chain-no-auth
      service: vikunja-laptop-svc
      tls:
        certResolver: dns-cloudflare
  services:
    vikunja-laptop-svc:
      loadBalancer:
        servers:
          - url: "http://10.16.0.233:90/"

Here is my vikunja frontend svc file -

http:
  routers:
    vikunja-frontend-laptop-svc:
      rule: "Host(`vikunja.{{env "DOMAINNAME_CLOUD_SERVER"}}`)"
      entryPoints:
        - https
      middlewares:
        - chain-no-auth
      service: vikunja-frontend-laptop-svc
      tls:
        certResolver: dns-cloudflare
  services:
    vikunja-frontend-laptop-svc:
      loadBalancer:
        servers:
          - url: "http://10.16.0.233:3456/"

Note - I was trying to hide my website, but I forgot to change silvsam.com on VIKUNJA_API_URL to mywebsite.com so yeah that is my website they are both the same however in the real docker-compose file

It looks like you exposed the api at the frontend path and the other way around.
And it looks like you’re trying to proxy the frontend traffic to port 90 on the container where it should be 80 (the port which the nginx in the frontend container is listening on).

Sorry for the late response, you were correct however I tried those fixes and it didn’t work. I realized that in the http routers in my traefik config that I was saying the same thing as in the vikunja api svc file and rule=Host(vikunja.$DOMAINNAME_CLOUD_SERVER) && PathPrefix(/api/v1, /dav/, /.well-known/)" and rule: “Host(vikunja.{{env "DOMAINNAME_CLOUD_SERVER"}})” were overlapping with eachother I got rid of the one in the traefik config and changed the one in the svc file as needed, that worked, thank you!

1 Like