This project sets up an Nginx proxy server using Docker. The proxy server routes traffic to different applications based on the URL path or subdomain.
The script automatically creates a Docker network and starts the Nginx container. It also ensures the container is stopped and the network is removed when the script exits.
./proxy.sh [options]-h, --help: Display the help message-c, --config <file>: Path to the Nginx configuration file-r, --root <dir>: Path to the static directory
./proxy.sh --config /path/to/nginx.conf --root /path/to/wwwThe proxy will stop automatically when you exit the script (e.g., by pressing CTRL+C).
The example Nginx configuration file (nginx.conf) includes settings for:
- General server settings
- HTTP settings
- Two main servers:
- One for routing traffic to
/firstapp/and/secondapp/ - Another for routing traffic to a subdomain
- One for routing traffic to
- Ensure Docker is installed and running on your system.
- Adjust the Nginx configuration file and static directory paths as needed.