# Error 405 when creating a user

**URL:** <https://community.vikunja.io/t/error-405-when-creating-a-user/928>\
**Category:** Support\
**Created:** [27 October 2022 05:33 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928 "2022-10-27T05:33:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NorskNoobing](https://community.vikunja.io/user_avatar/community.vikunja.io/norsknoobing/32/468_2.png) [@NorskNoobing](https://community.vikunja.io/u/NorskNoobing)\
**Post date:** [27 October 2022 05:33 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928/1 "2022-10-27T05:33:18Z")

</div>

I tried setting up vikunja, but it doesn’t seem quite right. One thing I’m wondering about is whether I should use the same domain for the frontend and api, or not. If not, how should I point the frontend to the right API url?

I’m getting this error when trying to create a user, which probably suggests problems with the links  
`frontend -> api` or `api -> db`

 ![image](https://community.vikunja.io/uploads/default/original/1X/51641b8ebd0b490315b638d2ff1655d66ab29d55.png)

Here’s my composefile:

```auto
...
# VIKUNJA
  api:
    container_name: vikunja-api
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: vikunja-db
      VIKUNJA_DATABASE_PASSWORD: $VIKUNJA_MYSQL_PASSWORD
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: $VIKUNJA_SERVICE_JWTSECRET
      VIKUNJA_SERVICE_FRONTENDURL: https://vikunja.$DOMAIN/
    volumes: 
      - $DATA/vikunja/files:/app/vikunja/files
    depends_on:
      - vikunja-db
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.vikunja-api.rule=Host(`vikunja.$DOMAIN`) && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`)"
      - "traefik.http.routers.vikunja-api.entrypoints=https"
      - "traefik.docker.network=default-network"
    networks:
      - default-network
  frontend:
    container_name: vikunja-frontend
    image: vikunja/frontend
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.vikunja.entrypoints=http"
      - "traefik.http.routers.vikunja.rule=Host(`vikunja.$DOMAIN`)"
      - "traefik.http.middlewares.vikunja-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.vikunja.middlewares=vikunja-https-redirect"
      - "traefik.http.routers.vikunja-secure.entrypoints=https"
      - "traefik.http.routers.vikunja-secure.rule=Host(`vikunja.$DOMAIN`)"
      - "traefik.http.routers.vikunja-secure.tls=true"
      - "traefik.http.routers.vikunja-secure.service=vikunja"
      - "traefik.http.services.vikunja.loadbalancer.server.port=80"
      - "traefik.docker.network=default-network"
    restart: unless-stopped
    networks:
      - default-network
  vikunja-db:
    container_name: vikunja-db
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: $VIKUNJA_MYSQL_ROOT_PASSWORD
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: $VIKUNJA_MYSQL_PASSWORD
      MYSQL_DATABASE: vikunja
    volumes:
      - $DATA/vikunja/db:/var/lib/mysql
    restart: unless-stopped
    command: --max-connections=1000
    networks:
      - default-network

```

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [27 October 2022 07:07 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928/2 "2022-10-27T07:07:42Z")

</div>

This looks like you did not expose the api via traefik as well. The browser accessing the frontend makes requests to the api so it needs to be accessible from the outside. Check out the traefik examples: [Full docker example | Vikunja](https://vikunja.io/docs/full-docker-example/#example-with-traefik-2)

---

<div class="post-metadata">

**Author:** ![NorskNoobing](https://community.vikunja.io/user_avatar/community.vikunja.io/norsknoobing/32/468_2.png) [@NorskNoobing](https://community.vikunja.io/u/NorskNoobing)\
**Post date:** [28 October 2022 17:59 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928/3 "2022-10-28T17:59:40Z")

</div>

> [@NorskNoobing](#):
>
> `"traefik.http.routers.vikunja-api.rule=Host(`vikunja.$DOMAIN`) && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`)"`

Isn’t it exposed through this? It’s a line from the vikunja-api in the composefile.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [30 October 2022 10:32 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928/4 "2022-10-30T10:32:27Z")

</div>

It should be, yes. Can you access the api at `DOMAIN/api/v1/info`?

---

<div class="post-metadata">

**Author:** ![NorskNoobing](https://community.vikunja.io/user_avatar/community.vikunja.io/norsknoobing/32/468_2.png) [@NorskNoobing](https://community.vikunja.io/u/NorskNoobing)\
**Post date:** [31 October 2022 00:31 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928/5 "2022-10-31T00:31:20Z")

</div>

When I go to “/api/v1/info” I just get redirected to the login page “/login”

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [31 October 2022 18:43 UTC](https://community.vikunja.io/t/error-405-when-creating-a-user/928/6 "2022-10-31T18:43:18Z")

</div>

Then theapi is not properly exposed. Check the traefik logs for error messages, maybe compare your version with the example from the docs: [Full docker example | Vikunja](https://vikunja.io/docs/full-docker-example/#example-with-traefik-2)
