Convert Figma logo to code with AI

evertramos logonginx-proxy-automation

Automated docker nginx proxy integrated with letsencrypt.

2,648
631
2,648
1

Top Related Projects

Automated nginx proxy for Docker containers using docker-gen

Docker container for managing Nginx proxy hosts with a simple, powerful interface

Generate files from docker container meta-data

Proxy over your Docker socket to restrict which requests it accepts

Quick Overview

The evertramos/nginx-proxy-automation repository is a Docker-based solution for automating the setup of Nginx as a reverse proxy with Let's Encrypt SSL certificates. It simplifies the process of managing multiple web applications behind a single Nginx instance, automatically handling SSL/TLS encryption and domain routing.

Pros

  • Easy setup and configuration for multiple web applications
  • Automatic SSL/TLS certificate generation and renewal using Let's Encrypt
  • Seamless integration with Docker and Docker Compose
  • Supports multiple domains and subdomains

Cons

  • Requires basic knowledge of Docker and networking concepts
  • May have a learning curve for users new to reverse proxies
  • Limited customization options compared to manual Nginx configuration
  • Potential single point of failure if not properly configured for high availability

Getting Started

  1. Clone the repository:

    git clone https://github.com/evertramos/nginx-proxy-automation.git
    
  2. Navigate to the project directory:

    cd nginx-proxy-automation
    
  3. Copy the sample .env file and configure it:

    cp .env.sample .env
    
  4. Edit the .env file to set your desired configuration options.

  5. Start the Nginx proxy:

    ./start.sh
    
  6. To add a new web application, create a Docker Compose file for your app and include the following environment variables:

    environment:
      - VIRTUAL_HOST=yourdomain.com
      - LETSENCRYPT_HOST=yourdomain.com
      - LETSENCRYPT_EMAIL=your@email.com
    
  7. Start your web application container, and the Nginx proxy will automatically detect and route traffic to it.

Competitor Comparisons

Automated nginx proxy for Docker containers using docker-gen

Pros of nginx-proxy

  • More established project with a larger community and longer history
  • Offers more advanced features and customization options
  • Supports a wider range of use cases and scenarios

Cons of nginx-proxy

  • Steeper learning curve and more complex setup process
  • Requires more manual configuration and management
  • May be overkill for simpler deployments or smaller projects

Code Comparison

nginx-proxy:

version: '2'
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro

nginx-proxy-automation:

version: '3'
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./certs:/etc/nginx/certs:ro
      - ./vhost.d:/etc/nginx/vhost.d
      - ./html:/usr/share/nginx/html

The nginx-proxy-automation project simplifies the setup process and includes additional configurations for SSL certificates and custom vhosts out of the box. It's more suitable for users who want a quick and easy setup with basic functionality. On the other hand, nginx-proxy offers more flexibility and control, making it a better choice for advanced users or complex deployments requiring fine-tuned configurations.

Docker container for managing Nginx proxy hosts with a simple, powerful interface

Pros of nginx-proxy-manager

  • User-friendly web interface for managing proxy hosts and SSL certificates
  • Built-in Let's Encrypt integration for easy SSL certificate management
  • Support for multiple users with different access levels

Cons of nginx-proxy-manager

  • Requires more system resources due to the web interface and database
  • Less lightweight compared to nginx-proxy-automation
  • May have a steeper learning curve for users new to proxy management

Code Comparison

nginx-proxy-manager (docker-compose.yml):

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

nginx-proxy-automation (docker-compose.yml):

version: '3'
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - certs:/etc/nginx/certs:ro
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html

Both projects aim to simplify Nginx reverse proxy setup, but nginx-proxy-manager offers a more user-friendly approach with its web interface and built-in SSL management. nginx-proxy-automation, on the other hand, provides a more lightweight solution that may be preferred by users comfortable with command-line operations and manual configuration.

Generate files from docker container meta-data

Pros of docker-gen

  • More flexible and customizable, allowing for advanced configurations
  • Supports a wider range of use cases beyond just Nginx reverse proxying
  • Has a larger community and more extensive documentation

Cons of docker-gen

  • Requires more manual setup and configuration
  • Steeper learning curve for beginners
  • May require additional components for full functionality (e.g., nginx-proxy)

Code Comparison

nginx-proxy-automation:

version: '3'
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"

docker-gen:

version: '3'
services:
  nginx:
    image: nginx:alpine
    volumes:
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
  docker-gen:
    image: jwilder/docker-gen
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro

The nginx-proxy-automation project provides a more streamlined setup with fewer configuration steps, making it easier for beginners to get started. However, docker-gen offers greater flexibility and customization options, allowing users to define their own templates and adapt the setup to various scenarios beyond just Nginx reverse proxying.

While nginx-proxy-automation is focused on providing a quick and easy solution for Nginx reverse proxying, docker-gen can be used in conjunction with other services and templates to create more complex and tailored configurations.

Proxy over your Docker socket to restrict which requests it accepts

Pros of docker-socket-proxy

  • Focused on security: Provides a secure way to expose Docker socket to other containers
  • Lightweight: Minimal overhead, as it only proxies specific Docker API endpoints
  • Flexible: Allows fine-grained control over which Docker API endpoints are exposed

Cons of docker-socket-proxy

  • Limited scope: Only handles Docker socket proxying, not full reverse proxy functionality
  • Manual configuration: Requires more setup for complex scenarios compared to nginx-proxy-automation
  • No built-in SSL support: Additional configuration needed for HTTPS

Code comparison

docker-socket-proxy:

version: '3'
services:
  dockerproxy:
    image: tecnativa/docker-socket-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - CONTAINERS=1

nginx-proxy-automation:

version: '3'
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./certs:/etc/nginx/certs:ro

While docker-socket-proxy focuses on secure Docker socket access, nginx-proxy-automation provides a more comprehensive solution for reverse proxying and automatic SSL configuration. The choice between the two depends on specific project requirements and security considerations.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

NGINX Proxy Automation 🔥

How to start 🔰

shell script

  1. Clone this repository using the option --recurse-submodules ⚠️
git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy 

We use submodule for basescript

  1. 🚀 Run the script 'fresh_start.sh' from the ./proxy/bin folder
cd proxy/bin && ./fresh-start.sh --yes --skip-docker-image-check -e your_email@domain

Update the email above with your real e-mail address

  1. 🧪 Test the proxy
docker run -dit -e VIRTUAL_HOST=your.domain.com --network=proxy --name test-web httpd:alpine

or simply run:

./test.sh your.domain.com

Use your own domain name when testing this proxy and make sure your DNS is correctly configured.

Video Tutorial 🎥

I made a tutorial video to walk you through this project:

youtube

AWS EC2

Digital Ocean Droplet

OVH

Server Automation 🚀

Make user you try our Server Automation

https://github.com/evertramos/server-automation

Further information 📓

For more installation details please click here.

Supporting ♥️

Patreon image

List of all supporters.

Code Contributors