- Plesk for Linux
How to configure nginx to proxy requests from domains to a docker container?
- Ensure that nginx is running in Plesk;
Map the port inside a container to a port on the host system (for example, 32768) manually under
Docker > select a container > Settings > clear the option "Automatic port mapping"
Set up nginx to proxy requests from domains to that port, so domains can use a standard port on nginx (for example, 80).
For this add a rule for nginx in the domain settings under Domains > example.com> Proxy Rules > Add Rule and specify the following:
- URL . Specify the URL of the website that uses an application running in a container. It can be either the main website or a part of it.
- Container . Select the application running as a Docker container.
. Select one of the mappings that was specified in the container settings (a port inside a container mapped to a port on your system). Nginx will proxy requests to the port on the system.