The ideal way to serve both Nginx Proxy Manager (NPM) and Lancache

The ideal way to serve both Nginx Proxy Manager (NPM) and Lancache is to have them listen on different ports and then forward the appropriate ports to each service.

Here’s how you can set it up:

  1. Lancache Configuration:

    • Run the Lancache container and have it listen on ports 8080 (HTTP) and 8443 (HTTPS) instead of the default 80 and 443.
    • You can do this by adding the following to your Lancache container run command:
      -p 8080:80 -p 8443:443
      
    • Alternatively, you can set the environment variables CACHE_HTTP_PORT and CACHE_HTTPS_PORT to 8080 and 8443 respectively.
  2. Nginx Proxy Manager Configuration:

    • In the NPM UI, create two proxy hosts:
      • Public Website: Forward ports 80 and 443 to your web application.
      • Lancache: Forward ports 8080 and 8443 to the Lancache container.
  3. Router Configuration:

    • Forward ports 80 and 443 to the NPM container.
    • Forward ports 8080 and 8443 to the Lancache container.

With this setup, the public-facing website will be served by NPM on ports 80 and 443, while the Lancache service will be accessible on ports 8080 and 8443. The router will forward the traffic to the appropriate service based on the port.

This way, both NPM and Lancache can run simultaneously without any conflicts, as they are listening on different ports. Clients accessing the Lancache service will need to use the appropriate ports (8080 and 8443) to connect to it.

By separating the ports, you can ensure that both services can run without any issues and provide the desired functionality.

1 Like