Sign inSign up

therandomsecurityguy/docker-nginx-ssl

By therandomsecurityguy

Updated over 10 years ago

Secured Dockerized NGINX image

Image
0

319

therandomsecurityguy/docker-nginx-ssl repository overview

Secured Dockerized NGINX image

Based off the NGINX Official Image.

Running the container

This Dockerfile is meant to be a base config for NGINX.

You should overwrite the /etc/nginx/external/ with a folder, containing your nginx *.conf files, certs, and PEM key. The DH size of 2048 can take a long time to create FYI:

docker run -d \
-p 80:80 -p 443:443 \
-e 'DH_SIZE=2048’ \
-v $EXT_DIR:/etc/nginx/external/ \
therandomsecurityguy/docker-nginx-ssl
Creating the PEM with openssl

To create a Diffie-Hellman cert, you can use the following command

openssl dhparam -out dh2048.pem 2048
Creating CSR with OpenSSL

Run the following command:

openssl req -nodes -new -newkey rsa:2048 -out csr.pem -sha256
Creating an SSL cert with OpenSSL
openssl req -x509 -newkey rsa:2048 \
-keyout key.pem -out cert.pem \
-days 3650 -nodes -sha256

Tag summary

Content type

Image

Digest

Size

77.7 MB

Last updated

over 10 years ago

docker pull therandomsecurityguy/docker-nginx-ssl