Sign inSign up

paulgrav/lets-nginx

By paulgrav

•Updated almost 11 years ago

Creates an HSTS, HTTP2, HTTPS enabled proxy for a specified backend.

Image
0

294

paulgrav/lets-nginx repository overview

⁠Let's Nginx with HTTP2

dockerhub build⁠

Put browser-valid TLS termination in front of any Dockerized HTTP service with one command.

docker run --detach \
  --name lets-nginx \
  --link backend:backend \
  --env [email protected] \
  --env DOMAIN=mydomain.horse \
  --env UPSTREAM=backend:8080 \
  --publish 80:80 \
  --publish 443:443 \
  paulgrav/lets-nginx

Issues certificates from letsencrypt⁠, installs them in nginx⁠, and schedules a cron job to reissue them monthly.

:zap: To run unattended, this container accepts the letsencrypt terms of service on your behalf. Make sure that the subscriber agreement⁠ is acceptable to you before using this container. :zap:

⁠Prerequisites

Before you begin, you'll need:

  1. A place to run Docker containers⁠ with a public IP.
  2. A domain name with an A record pointing to your cluster.

⁠Usage

Launch your backend container and note its name, then launch smashwilson/lets-nginx with the following parameters:

  • --link backend:backend to link your backend service's container to this one. (This may be unnecessary depending on Docker's networking configuration⁠.)
  • -e EMAIL= your email address, used to register with letsencrypt.
  • -e DOMAIN= the domain name.
  • -e UPSTREAM= the name of your backend container and the port on which the service is listening.
  • -p 80:80 and -p 443:443 so that the letsencrypt client and nginx can bind to those ports on your public interface.

Tag summary

Content type

Image

Digest

Size

183 MB

Last updated

almost 11 years ago

docker pull paulgrav/lets-nginx