https://gitlab.com/tozd/docker/nginx
Available as:
tozd/base
← tozd/dinit
← tozd/nginx
ubuntu-trusty
: nginx 1.4.6ubuntu-xenial
: nginx 1.10.3ubuntu-bionic
: nginx 1.14.0ubuntu-focal
: nginx 1.18.0ubuntu-jammy
: nginx 1.18.0
/var/log/nginx
: Log files whenLOG_TO_STDOUT
is not set to1
./etc/nginx/sites-volume
: Nginx configuration for sites served by the container.
SET_REAL_IP_FROM
: Configuresset_real_ip_from
which defines trusted addresses that are known to send correct replacement addresses. If the container is run behind a reverse HTTP proxy, you can set this environment variable to configure proxy's IP address for Nginx to correctly resolve and log clients' IP addresses.LOG_TO_STDOUT
: If set to1
output logs to stdout (retrievable usingdocker logs
) instead of log volumes.
80/tcp
: HTTP port on which Nginx listens.
Image providing Nginx HTTP server.
The intended use of this image is that it is extended for images which serve content over the HTTP.
Access logs are formatted as JSON.
You can use defined json
log format to format additional access logs as JSON as well.
When LOG_TO_STDOUT
is set to 1
, Docker image logs output to stdout and stderr. All stdout output is JSON.
When extending the image, you can put sites configuration files under /etc/nginx/sites-enabled/
to add custom sites.
Alternatively, you can mount a volume into /etc/nginx/sites-volume/
directory and provide sites there.
When you are extending this image, you can add a script /etc/service/nginx/run.initialization
which will be run at a container startup, after the container is initialized, but before the
Nginx daemon is run.
There is also a read-only GitHub mirror available, if you need to fork the project there.