NGINX Docker container

Minimal nginx docker container that supports static websites and HTTP proxy.

The container contains a minimal NGINX server optimized for:

Built with the latest versions of NGINX and OpenSSL.

Modules not needed for either HTTP proxies or static websites (like the fastcgi, mirror, referer, mail modules) have not been compiled in the NGINX binary. This means it can’t be used as a drop-in replacement for most NGINX installs.

What’s inside?

This container is built from scratch and contains:

No other applications are available.

How to use

Mount a directory containing nginx configuration (mainly your server{} blocks) on /etc/nginx/conf.d. The sane default config shipped with this container will include every file in that directory. In case you want to overwrite everything, mount a full nginx configuration in /etc/nginx.

Additional config files are shipped in the /etc/nginx/extra.d folder:

An example docker command:

docker run \
	--name nginx \
	--rm \
	-v /etc/nginx/conf.d:/path/to/your/configuration:ro \
	-v /srv/web:/path/to/your/document-roots:ro \
	-v /var/log/nginx:/path/to/your/logs \

Check the container on Docker Hub or the Git repository.