Skip to content

Using Docker and Reverse Proxy Requires Specific APP_URL= Setting #553

Closed

Description

@Riftr

To use Docmost behind a reverse proxy such as Traefik on Docker requires you to set the APP_URL environment variable to:

APP_URL=https://0.0.0.0:3000

The problem is that the documentation at https://docmost.com/docs/installation doesn't reflect this and instead says:

The APP_URL should be replaced with your chosen domain. E.g. https://example.com or https://docmost.example.com.

This could be updated with a note for Docker and reverse proxy users that you need to tell Docmost to listen on all networks in order for it to work in this setup.

Activity

  1. Philipinho commented on Dec 12, 2024

    @Philipinho
    Member

    The APP_URL has nothing to do with the docker network. Its usage is only for internal links and links in emails.

    The server is by default configured to listen on all network interfaces.

    await app.listen(process.env.PORT || 3000, '0.0.0.0');

  2. Philipinho commented on Dec 14, 2024

    @Philipinho
    Member

    Feel free to reopen if this issue persists.

  3. pedrolaranjeiro commented on Feb 18, 2025

    @pedrolaranjeiro

    In my case the websocket was not working with the Nginx engine.
    My original redirection with the websocket failing was:

    location / {
        proxy_pass http://12.1.1.50:12786/
    }
    

    To make it work I added

    location / {
       proxy_pass http://12.1.1.50:12786/
       # WebSocket support
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }
    
  4. arch-fan commented on Mar 3, 2025

    @arch-fan

    In my case I wasn't specifying the network which had the service.

    - "traefik.docker.network=proxied"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions