Skip to content

ensombl/simple-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-proxy

Minimal Docker-deployable nginx reverse proxy. Configuration is rendered at container startup from environment variables, so the same image can proxy to different upstreams.

Required configuration

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.

Local build

cp .env.example .env
# Edit PROXY_TARGET in .env
docker build -t simple-proxy .
docker run --rm -p 8080:80 --env-file .env simple-proxy

Health checks:

curl http://localhost:8080/healthz
curl http://localhost:8080/readyz

Deployment

Build 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-proxy

The proxy exposes /healthz and /readyz without touching the upstream. All other paths are proxied to PROXY_TARGET.

About

Minimal env-driven nginx reverse proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors