bfren/nginx

By bfren

Updated about 5 hours ago

Image
0

50K+

Docker Nginx

GitHub release (latest by date)Docker PullsDocker Image SizeGitHub Workflow Status

Docker Repository - bfren ecosystem

A simple Nginx base image - no SSL support etc, designed to be used behind a proxy server.

Files are served from /www/public (which can be overridden using BF_NGINX_PUBLIC_OVERRIDE).

Contents

Ports

  • 80

Volumes

VolumePurpose
/wwwFiles in this directory are served by Nginx (if not mapped, a 'Welcome to Nginx' message will be served).

Environment Variables

VariableValuesDescriptionDefault
BF_NGINX_FORWARD_ACCESS_LOG0 or 1If 1, the access log will be forwarded to Docker's stdout.0
BF_NGINX_HEALTHCHECK_URIURIThe URI to load during the healthcheck.http://localhost
BF_NGINX_IGNORE_FAVICON0 or 1If 1, a helper configuration file will contain a directive to return 204 (No Content) when a favicon is requested.1
BF_NGINX_PUBLIC_OVERRIDEstringIf set, it will be used as the nginx root directory (which by default is /www).blank

Helper Functions

FunctionArgumentsDescriptionUsage
healthcheckNoneLoads BF_NGINX_HEALTHCHECK_URI to check everything is working.docker exec <<CONTAINER>> healthcheck
nginx-reloadNoneTests Nginx configuration and if successful, reloads the Nginx server.docker exec <<CONTAINER>> nginx-reload

Nginx Configuration Helpers

The image contains a handful of useful Nginx configuration 'helper' files, which you can find in /overlay/etc/nginx/helpers. They all begin with the prefix 'nginx':

HelperDescription
-base.confBasic configuration, sets listen port, document root, and adds the GNU Terry Pratchett header.
-ignore-favicon.confReturns 204 for favicon.ico requests that do not exist, and stops it being added to the error log.
-error-pages.confInclude if you want to use Nginx's default error pages.
-static-files.confSets useful headers, cache, and expiration values for serving static files.
-uploads.confSets client_max_body_size to 0 - so there is no limit on file upload size.

Licence

Copyright

Copyright (c) 2020-2025 bfren (unless otherwise stated)

Docker Pull Command

docker pull bfren/nginx