Nginx and openssl built from source in a Docker image to provide out of the box TLS 1.3 support.
- Image includes pre-built, self signed key and certificate
- Container runs as non-root (user
nginx
is created and used) - Support for mounting custom configurations
You can skip the build and get the Docker image
docker pull eldada-docker-examples.bintray.io/nginx-tls13:1.15.8-0.1
Build Docker image
docker build -t eldada-docker-examples.bintray.io/nginx-tls13:1.15.8-0.1 .
Start the Docker container with ports 80 and 443 exposed
docker run --name nginx -p 80:80 -p 443:443 eldada-docker-examples.bintray.io/nginx-tls13:1.15.8-0.1
You can override default configuration files nginx.conf and mime.types.
- Create your custom
nginx.conf
- Mount the custom file to
/etc/nginx/nginx.conf
q
docker run --name nginx -p 80:80 -p 443:443 -v ${CUSTOM_NGINX_CONF}:/etc/nginx/nginx.conf eldada-docker-examples.bintray.io/nginx-tls13:1.15.8-0.1
Follow the same procedure to override mime.types
.
You can add custom configuration files to nginx
- Prepare a directory for your configuration files
- Prepare one or more configuration files with the
.conf
extension in the configuration directory - Mount the configuration directory to container's
/etc/nginx/conf.d
docker run --name nginx -p 80:80 -p 443:443 -v ${PATH_TO_CONFIG_DIR}:/etc/nginx/conf.d eldada-docker-examples.bintray.io/nginx-tls13:1.15.8-0.1
You can add a custom html directory
- Prepare a directory with your custom html files (and any other resources needed)
- Mount the htm directory to container's
/etc/nginx/html
docker run --name nginx -p 80:80 -p 443:443 -v ${PATH_TO_HTML}:/etc/nginx/html eldada-docker-examples.bintray.io/nginx-tls13:1.15.8-0.1
For supporting the TLS 1.3, openssl 1.1.1 is used
Current Nginx version is 1.15.8
This repository is initially forked and inspired from https://github.com/ricardbejarano/nginx.