A minimal Docker image that runs nginx as a reverse proxy / TCP forwarder. Configuration is fully driven by environment variables at container startup — no config files to edit.
On start, entrypoint.sh uses envsubst to render nginx.conf.template into a live nginx config, then launches nginx in the foreground. The resulting proxy:
UPSTREAM_URLHost header to PROXY_HOST/healthz endpoint that returns 200 ok| Variable | Description | Example |
|---|---|---|
UPSTREAM_URL | Full URL of the upstream server | http://1.1.1.1:80 |
PROXY_HOST | Value for the Host header sent upstream | example.com |
The container will refuse to start if either variable is missing.
docker run -p 80:80 \
-e UPSTREAM_URL=http://10.0.0.1:3000 \
-e PROXY_HOST=myapp.internal \
nginx-fwd
docker build -t nginx-fwd .
curl http://localhost:80/healthz
# ok
services:
proxy:
build: .
ports:
- "80:80"
environment:
UPSTREAM_URL: http://backend:3000
PROXY_HOST: backend
Content type
Image
Digest
sha256:5c4b5b823…
Size
26.1 MB
Last updated
5 months ago
docker pull s4l3h1/nginx-fwd