A simple example using NGINX to reverse proxy requests to other docker containers.
Make sure both docker and docker compose are installed.
Run docker-compose up
(or docker-compose up -d
to run in detached mode) in the root of this project. This will start 3 containers:
This is the nginx container that contains the proxy rules to route requests to the other containers. The nginx configuration file for this container is in proxy/nginx.conf
. The configuration file is a modified default NGINX configuration file that was copied from a running nginx container, and modified to include the proxy rules.
All requests to /a/
will be proxied to this container.
All requests to /b/
will be proxied to this container.