This project provides a simple shell script to quickly set up an Nginx reverse proxy with automatic HTTPS configuration using Let's Encrypt. It supports reverse proxy configuration for multiple ports.
- Automatic Nginx reverse proxy configuration
- Automatic SSL certificate acquisition and renewal using Let's Encrypt
- Support for multiple port reverse proxy configurations
- Deployment using Docker and Docker Compose
- Docker and Docker Compose installed
- A domain name pointing to your server's IP address
-
Clone this repository:
git clone https://github.com/yourusername/nginx-certbot-multiport.git cd nginx-certbot-multiport
-
Run the setup script:
./setup.sh
-
Follow the prompts to enter:
- Your domain name
- Your email address (for Let's Encrypt notifications)
- The ports you want to reverse proxy (you can enter multiple, one per line)
-
After the script completes, navigate to the newly created directory and start the services:
cd <your_domain> && docker-compose up -d
The script will create a new directory named after your domain. Inside this directory, you'll find:
nginx-conf/
: Contains the Nginx configuration filedocker-compose.yml
: The Docker Compose file for running the Nginx-Certbot container
If you need to modify the Nginx configuration or Docker Compose setup, you can edit the respective files in the created domain directory.
- Ensure your firewall allows traffic on ports 80 and 443
- If your services are not running on the same machine, you'll need to modify the
proxy_pass
address in the generated Nginx configuration file
If you encounter any issues, check the Docker logs:
docker-compose logs nginx-certbot
Issues and Pull Requests are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.