Coder Social home page Coder Social logo

henrist / nginx-letsencrypt Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 13 KB

Docker image for running nginx with self-updating Let's Encrypt certificates

Home Page: https://hub.docker.com/r/henrist/nginx-letsencrypt

Shell 85.04% Dockerfile 14.96%

nginx-letsencrypt's Introduction

nginx with Let's Encrypt self-updating certificates

This Docker image lets you run nginx with self-updating Let's Encrypt certificates.

Let's Encrypt setup is handled with https://github.com/lukas2511/dehydrated

The domains to be handled is generated from the contents of nginx configuration.

Configuring vhosts to allow self-updating

All vhosts must alias the dehydrated folder. Make sure all vhosts for domains listed in domains.txt contains:

    location /.well-known/acme-challenge {
        alias /var/www/dehydrated;
    }

Example run

Create the file default.conf with correct domain names

server {
    listen 443 ssl;
    server_name example.com;

    ssl_certificate /opt/dehydrated/certs/example.com/fullchain.pem;
    ssl_certificate_key /opt/dehydrated/certs/example.com/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    location /.well-known/acme-challenge {
        alias /var/www/dehydrated;
    }

    location / {
        root /usr/share/nginx/html;
        index index.html;
    }
}

server {
    listen 80;
    server_name example.com;
    return 302 https://example.com$request_uri;
}

Start the container

docker run \
  -it --rm \
  -e [email protected] \
  -e LE_STAGING=1 \
  -v dehydrated-certs:/opt/dehydrated/certs \
  -v dehydrated-accounts:/opt/dehydrated/accounts \
  -v "$(pwd)/default.conf":/etc/nginx/conf.d/default.conf \
  -p 80:80 -p 443:443 \
  henrist/nginx-letsencrypt

Open https://example.com/ and you should see nginx default welcome page

Remove LE_STAGING if you don't want it to run against Let's Encrypt staging api. You will have to remove the certificates if you first run with LE_STAGING and then want to generate real certificates.

nginx-letsencrypt's People

Contributors

henrist avatar renovate-bot avatar

Watchers

 avatar  avatar

nginx-letsencrypt's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
example/docker-compose.yml
dockerfile
Dockerfile
  • nginx 1.17-alpine

  • Check this box to trigger a request for Renovate to run again on this repository

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.