Skip to content

Maks0u/nginx-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published