Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.16 KB

File metadata and controls

42 lines (27 loc) · 1.16 KB

Nginx proxy

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.

Usage

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]

Options

  • -h, --help: Display the help message
  • -c, --config <file>: Path to the Nginx configuration file
  • -r, --root <dir>: Path to the static directory

Example

./proxy.sh --config /path/to/nginx.conf --root /path/to/www

Stoping the Proxy

The proxy will stop automatically when you exit the script (e.g., by pressing CTRL+C).

Configuration

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

Notes

  • Ensure Docker is installed and running on your system.
  • Adjust the Nginx configuration file and static directory paths as needed.