nginx
Provides the open-source NGINX web server in a ready-to-run container format.
What is nginx
The nginx image provides the open-source NGINX web server in a ready-to-run container format. NGINX is a high-performance HTTP server, reverse proxy, and load balancer known for its stability, low resource usage, and ability to handle high concurrency. It’s widely used for serving static content, terminating TLS, load balancing across services, and acting as a gateway in containerized and microservice architectures.
It’s commonly used in production to expose containerized applications to the internet or to route traffic between internal services. The nginx image is relevant for developers building modern web infrastructure, and is frequently deployed in Kubernetes clusters, CI/CD pipelines, and edge environments.
How to use this image
The nginx image is commonly used to serve static content, reverse proxy to backend services, or run custom configurations. It listens on port 80 by default.
Basic usage:
Serve static files with a volume mount:
Use a custom nginx.conf:
Drop in additional configuration:
Build a custom image with static content baked in:
This approach is recommended for production deployments, as it avoids dependency on runtime-mounted volumes.
Logging:
Image variants
The nginx image supports multiple variants depending on the base OS and use case:
The default tag, typically based on Debian. Includes full NGINX functionality with modules and package manager support. Use this when you need compatibility, configurability, and Debian tooling.•nginx:alpine
Based on Alpine Linux. Much smaller image size, but includes fewer packages by default. Ideal for minimal containers where small size and security are priorities.
Tracks the mainline (development) branch of NGINX instead of the stable release. Use these if you want the latest features or are testing changes before they land in stable.
Why use nginx with echo
With echo, the nginx image is CVE-free, so you don’t have to worry about debloating, patching, or hardening.