Git Product home page Git Product logo

nginx-docker-ssl's Introduction

CertBot SSL with Nginx inside Docker

An Nginx Dockerfile and docker-compose setup that includes the python-certbot-nginx script which helps generating instant SSL certificates for the Nginx proxy.

Setup

  • docker-compose.yml file that composes the Nginx reverse proxy and all other custom Docker images
  • ./nginx directory that contains the Dockerfile of Nginx with a built-in CertBot installation
  • ./letsencrypt directory which acts as a volume for the Nginx image inside docker-compose to maintain the certificate throughout redeployments

Usage

Make sure to include an nginx-volume for letsencrypt as shown in the docker-compose file to maintain the ssl-certificate after a redeployment, otherwise you may get rate-limited for a week for too many re-tries.

  1. Add all your domains (including subdomains) that should have HTTPS to the default-conf file.

  2. docker-compose up -d

  3. Run docker-compose ps to get the name of the running Nginx container & copy it

  4. Execute the Nginx docker container using bash: docker exec -it [name_of_nginx_container] bash

  5. Run the python-certbot-nginx script including all domain names (including subdomains) that should have HTTPS: certbot --nginx -d [domain1] -d [domain2]... And follow the given instructions.

  6. Press Ctrl + d to exit bash

  7. Check if your SSL certificate works here and vist https://[your_domain]


Optional Usage

The Nginx Docker image can also be pulled and integrated to docker-compose directly from Dockerhub under the image name: max37/nginx-ssl:latest. Note that this image exposes the ports 443 and 80 automatically as part of the Dockerfile setup.

nginx-docker-ssl's People

Contributors

maxeth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.