Minimal Docker-deployable nginx reverse proxy. Configuration is rendered at container startup from environment variables, so the same image can proxy to different upstreams.
| Variable | Required | Default | Description |
|---|---|---|---|
PROXY_TARGET |
yes | none | Upstream origin, for example https://upstream.example.com. Do not include a trailing slash. |
PUBLIC_HOSTNAME |
no | qcmobile-proxy.dev.ensombl.io |
Hostname nginx should accept for the public proxy. |
PROXY_HOST_HEADER |
no | nginx $proxy_host |
Host header sent to the upstream. Set this when the upstream requires a specific host. |
CLIENT_MAX_BODY_SIZE |
no | 25m |
Maximum request body size. |
PROXY_CONNECT_TIMEOUT |
no | 10s |
Upstream connection timeout. |
PROXY_SEND_TIMEOUT |
no | 60s |
Upstream send timeout. |
PROXY_READ_TIMEOUT |
no | 60s |
Upstream read timeout. |
PROXY_BUFFERING |
no | on |
nginx proxy buffering, on or off. |
cp .env.example .env
# Edit PROXY_TARGET in .env
docker build -t simple-proxy .
docker run --rm -p 8080:80 --env-file .env simple-proxyHealth checks:
curl http://localhost:8080/healthz
curl http://localhost:8080/readyzBuild the image and run it with the live hostname and upstream target:
docker build -t simple-proxy .
docker run --rm -p 80:80 \
-e PUBLIC_HOSTNAME=qcmobile-proxy.dev.ensombl.io \
-e PROXY_TARGET=https://upstream.example.com \
simple-proxyThe proxy exposes /healthz and /readyz without touching the upstream. All other paths are proxied to PROXY_TARGET.