Not sure if this is a bug or a misconfiguration, though I'm starting to lean towards it being a bug of some sort, because even reverting to a known-good configuration is failing.
Joplin Server v2.12.1
Docker 24.0.6
nginx 1.25.2
Ubuntu 22.04
Postgres 15.4-1.pgdg120+1
Portainer CE 2.19.0
Installed Joplin & Postgres in a stack via Portainer:
version: '3'
services:
db:
image: postgres:15
volumes:
- ./data/postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DATABASE}
app:
image: joplin/server:latest
container_name: joplin-server
depends_on:
- db
ports:
- "127.0.0.1:22300:22300"
restart: unless-stopped
environment:
- APP_PORT=${APP_PORT}
- APP_BASE_URL=${APP_BASE_URL}
- DB_CLIENT=pg
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DATABASE=${POSTGRES_DATABASE}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=db
env variables:
POSTGRES_PASSWORD=testing
POSTGRES_USER=joplin
APP_BASE_URL=https://joplin.homelab.lan
POSTGRES_PORT=5432
APP_PORT=22300
nginx configuration:
worker_processes auto;
events {}
http {
server {
listen 80;
server_name joplin.homelab.lan;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name joplin.homelab.lan;
location /login {
proxy_pass http://joplin-server.joplin_default:22300/login;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
client_max_body_size 50M;
proxy_pass http://joplin-server.joplin_default:22300/$request_uri;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
ssl_certificate /etc/nginx/ssl/docker.crt;
ssl_certificate_key /etc/nginx/ssl/docker.pem;
}
server {
listen 443 ssl;
server_name pihole.homelab.lan;
location /admin {
client_max_body_size 50M;
proxy_pass http://pihole.pihole_default/admin;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
ssl_certificate /etc/nginx/ssl/docker.crt;
ssl_certificate_key /etc/nginx/ssl/docker.pem;
}
}
The nginx shares the Joplin network and is able to reach the "joplin-server.joplin_default" host. This configuration had been working, but I ran into an issue with the "/admin" path between Joplin and Pi.Hole, so I set up the "pihole.homelab" and "joplin.homelab" hostnames and updated the nginx.conf file to point to the hostnames.
I am able to reach the "/login" page and enter my credentials, but when it redirects to "/home" after successful login, I receive a 404 "Path not found: home" This is true for "/admin", and "/api/ping" as well.
When I look at the logs, it seems that most "/js" and "/css" are working properly, but anything user facing is not:
2023-09-07 22:03:08: App: GET //home (404) (17ms)
2023-09-07 22:03:09: App: GET //css/bulma.min.css (200) (2ms)
2023-09-07 22:03:09: App: GET //js/jquery.min.js (200) (131ms)
2023-09-07 22:03:09: App: GET //css/main.css (200) (275ms)
2023-09-07 22:03:09: App: GET //js/main.js (200) (6ms)
2023-09-07 22:03:09: App: GET //css/fontawesome/css/all.min.css (200) (2ms)
2023-09-07 22:03:13: [error] App: 404: GET //admin: FyNO47yft8ptM72lF7Kn2I: Path not found: admin
2023-09-07 22:03:13: App: GET //admin (404) (2ms)
2023-09-07 22:03:13: App: GET //css/bulma.min.css (200) (137ms)
2023-09-07 22:18:52: App: GET //css/main.css (200) (2ms)
2023-09-07 22:18:52: App: GET //css/fontawesome/css/all.min.css (200) (263ms)
2023-09-07 22:18:52: App: GET //js/jquery.min.js (200) (7ms)
2023-09-07 22:18:52: App: GET //js/main.js (200) (4ms)
2023-09-07 22:18:53: App: GET //images/Logo.png (200) (1ms)
2023-09-07 22:18:53: App: GET //css/fontawesome/webfonts/fa-solid-900.woff2 (200) (1ms)
2023-09-07 22:19:03: [error] App: 404: GET //users/me: FyNO47yft8ptM72lF7Kn2I: Path not found: users/me
2023-09-07 22:19:03: App: GET //users/me (404) (1ms)
2023-09-07 22:19:03: App: GET //css/bulma.min.css (200) (135ms)
2023-09-07 22:19:04: App: GET //css/main.css (200) (271ms)
For what it's worth, "joplin.homelab.lan" is a CNAME pointing to 10.0.0.6, the Docker server. 10.0.0.6 reverse resolves to "dockervm.homelab.lan," in case that makes any difference.
I've nuked the stack a few times and re-installed it, but can't seem to figure out what's causing this issue.
Any help appreciated.
Thanks!