Code Monkey home page Code Monkey logo

docker-nginx-letsencrypt-oauth2's Introduction

Dockerized Nginx with Let's Encrypt

Docker Automated buil

This container provides an Nginx application with Let's Encrypt certificates generated at startup, as well as renewed (if necessary) and Nginx gracefully restarted.

Usage

docker run \
    -e CERTS=my.domain,my.other.domain \
    -e [email protected] \
    -v /etc/ssl/dhparam:/etc/ssl/dhparam \
    -v /srv/letsencrypt:/etc/letsencrypt \
    -p 80:80 -p 443:443
    bradjonesllc/docker-nginx-letsencrypt

You will almost certainly want to create an image FROM bradjonesllc/docker-nginx-letsencrypt this image or mount your Nginx config at /etc/nginx/nginx.conf.

Super-simple microservices pattern

This base container creates a symlink for the "first" Let's Encrypt certificate it finds on initial startup, and it's used as the default certificate for Nginx SSL. So, without having to specify in code the domain name, you can use a DNS alias (e.g., in a Docker overlay network) to create a zero-downtime upgrade proxy:

resolver 127.0.0.1; # The bundled dnsmasq daemon

server {
    listen 443 ssl;
    location / {
        set $backend servicename;
        proxy_pass http://$backend;
    }
}

License and Copyright

© Brad Jones LLC, Licensed under GPL-2.

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.