Skip to content
Reverse Proxy

Reverse Proxy

Out of the box, Healdan listens on 127.0.0.1:8080, so only the machine running Docker can reach it, and only over plain HTTP. To use it from other machines, put a reverse proxy in front of it that handles HTTPS.

Whichever proxy you use:

  • Set LOGICALDOC_PUBLIC_URL in .env to the public HTTPS address, so links and emails use it.
  • Forwarded headers. The proxy sends X-Forwarded-For and X-Forwarded-Proto. Tomcat trusts them only from private, loopback and link-local addresses, so Healdan sees HTTPS and each user’s real IP address only when the proxy reaches it from one of those.
  • WebSockets and large uploads. The proxy must forward WebSockets (Healdan pushes live updates at /wk-event) and allow large uploads and long requests.

With Nginx Proxy Manager (NPM) on the same Docker host, NPM runs in its own container, so it reaches Healdan over a shared Docker network rather than a port on the host.

  1. Find NPM’s network. Run docker network ls. If NPM was started from a folder named npm, the network is npm_default. To confirm, run docker inspect <npm-container> --format '{{json .NetworkSettings.Networks}}'.

  2. Edit .env and restart. Set these, then run docker compose up -d:

    .env
    COMPOSE_FILE=compose.yaml:compose.proxy.yaml
    PROXY_NETWORK=npm_default
    LOGICALDOC_PUBLIC_URL=https://docs.example.org

    The app no longer publishes a port on the host. NPM reaches it on that network as logicaldoc:8080.

  3. Add a proxy host in NPM (Hosts → Proxy Hosts → Add Proxy Host):

    • Details: Domain Names docs.example.org, Scheme http, Forward Hostname logicaldoc, Forward Port 8080. Turn on Block Common Exploits and Websockets Support.

    • SSL: request a new Let’s Encrypt certificate, and turn on Force SSL and HTTP/2 Support.

    • Advanced, under Custom Nginx Configuration, so large uploads and long conversions aren’t cut off:

      client_max_body_size 0;
      proxy_request_buffering off;
      proxy_read_timeout 300s;
      proxy_send_timeout 300s;
  4. Save, then open https://docs.example.org.

SymptomCause
network npm_default declared as external, but could not be foundPROXY_NETWORK doesn’t match NPM’s network
502 Bad GatewayNPM isn’t on that network, or the app isn’t healthy. Check docker compose ps; docker network inspect <network> should list both containers
The app loads but live updates failTurn on Websockets Support
413 Request Entity Too LargeAdd the Advanced snippet