Error 502 when using caddy (Joplin Server)

Hello everybody !
I am actually trying to self host Joplin using Caddy as a reverse proxy and Docker. I get the following error code when i try to access to the admin panel (and when i access it i get a 502 error). I know it is due to Caddy being unable to reach my Joplin, but i can't see my mistake.

joplin-caddy-1  | "msg":"dial tcp :22300: connect: connection refused" 

Here are my Caddyfile and my docker-compose.yml file :


version: '3'

services:
    db:
        image: postgres:15
        networks:
          - db
        volumes:
            - ./data/postgres:/var/lib/postgresql/data
        ports:
            - "5432:5432"
        restart: unless-stopped
        environment:
            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
            - POSTGRES_USER=${POSTGRES_USER}
            - POSTGRES_DB=${POSTGRES_DATABASE}
    app:
        image: joplin/server:2.10.5-beta
        depends_on:
            - db
        ports:
            - "22300:22300"
        restart: unless-stopped
        networks:
          - db
          - web
        environment:
            - APP_PORT=22300
            - 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
    caddy:
      image: caddy:2.6.2
      networks:
        - web
      restart: unless-stopped
      ports:
        - "80:80"
        - "443:443"
        - "443:443/udp"
      volumes:
        - $PWD/Caddyfile:/etc/caddy/Caddyfile
        - $PWD/site:/srv
        - caddy_data:/data
        - caddy_config:/config
        - ./Caddyfile:/etc/caddy/Caddyfile:ro

networks:
  db:
  web:
    external: true

volumes:
  caddy_data:
    external: true
  caddy_config:
    external: true
  db:
    external: true

Caddyfile:

notes.example.com {
        encode zstd gzip
        reverse_proxy 127.0.0.1:22300 {
               header_up Host {upstream_hostport}
        }
}

And i'm using the .env file recommended in the GitHub repo.

Thanks !

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