Skip to content

anpleenko/docker-nginx-http2-ssl

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Supported tags and respective Dockerfile links

Test HTML content in a Docker Container. Based on the official Nginx Images, the configuration has been setup to also include includes HTTP2 and SSL support.

Setup

SSL Certificate Authority

To create the SSL Key and Certificate Files, we use mkcert.

mkcert is a simple tool for making locally-trusted development certificates. It requires no configuration.

Steps

  1. Install mkcert.

  2. Create and Install SSL Key and Certificate.

$ mkcert -install -key-file key.pem -cert-file cert.pem localhost.dev "*.localhost.dev" localhost 127.0.0.1 ::1

Created a new certificate valid for the following names ๐Ÿ“œ
 - "localhost.dev"
 - "*.localhost.dev"
 - "localhost"
 - "127.0.0.1"
 - "::1"

The certificate is at "cert.pem" and the key at "key.pem" โœ…

These files need to be mounted into container.

Usage

To host files in your the current directory.

$ docker run -ti \
   -v (path to cert.pem):/ssl/cert.pem \
   -v (path to key.pem):/ssl/key.pem \
   -v $PWD:/usr/share/nginx/html \
   -p 80:80 -p 443:443 \
   stephenyu/nginx-http2-ssl

Navigate to https://localhost (or any of the above names, the certificate was generated for) and you should be able to see your content.

About

Nginx HTTP2 SSL Docker Files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 100.0%