Hello. I am trying to access my Vikunja instance through the internet. I have Vikunja set up with docker, using nginx as proxy. On the outside, I’m using SWAG, by LinuxServer. Thus, my access layout looks like this:
WAN → vikunja.mydomain.com → SWAG (nginx as Reverse Proxy + Authelia) → Vikunja’s nginx → Vikunja
I’ve managed to configure access through SWAG correctly, but when arriving at Vikunja, I get a 403 Forbidden error. Everything works correctly when Vikunja is accessed from within my local network. If I were to guess, I think it’s because the frontend URL is not specified correctly (since I’m not really sure what it is). Here are my configurations:
Vikunja’s docker-compose.yml:
version: '3'
services:
db:
image: ghcr.io/linuxserver/mariadb
container_name: vikunja_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=db_rootpassword
- TZ=Europe/London
- MYSQL_DATABASE=db_name
- MYSQL_USER=db_user
- MYSQL_PASSWORD=db_password
volumes:
- /home/user/data/vikunja/mariadb:/config
restart: unless-stopped
api:
image: vikunja/api
container_name: vikunja_api
ports:
- 3456:3456
environment:
VIKUNJA_DATABASE_HOST: vikunja_db
VIKUNJA_DATABASE_PASSWORD: db_password
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: db_user
VIKUNJA_DATABASE_DATABASE: db_name
VIKUNJA_SERVICE_ENABLETASKATTACHMENTS: 1
volumes:
- /home/user/data/vikunja:/app/vikunja/files
depends_on:
- db
restart: unless-stopped
frontend:
image: vikunja/frontend
container_name: vikunja_frontend
restart: unless-stopped
proxy:
image: nginx
container_name: vikunja_proxy
ports:
- 8022:80
volumes:
- /home/user/data/vikunja/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api
- frontend
restart: unless-stopped
SWAG’s nginx reverse proxy configuration:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name vikunja.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
# enable for Authelia
include /config/nginx/authelia-server.conf;
# geoip block
if ($denied_highrisk = no) { return 444; }
location / {
# enable for Authelia
include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app vikunja_proxy;
set $upstream_port 8022;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
root /;
try_files $uri $uri/ /;
index index.html index.htm;
}
location ~* ^/(api|dav|\.well-known)/ {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $api_app vikunja_api;
set $api_port 3456;
set $api_proto http;
proxy_pass $api_proto://$api_app:$api_port;
client_max_body_size 20M;
}
}
Perhaps it has something to do with the root parameter?
Thank you for your help and work.