Giter Site home page Giter Site logo

stephenyu / docker-nginx-http2-ssl Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 6 KB

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

Home Page: https://hub.docker.com/r/stephenyu/nginx-http2-ssl

Dockerfile 100.00%
dockerfile docker nginx ssl http2

docker-nginx-http2-ssl's Introduction

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.

docker-nginx-http2-ssl's People

Contributors

stephenyu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

anpleenko snussik

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.