Releases: byjg/docker-static-httpserver
Release list
v0.5.1
v0.5.0
HTTPS that a client can actually trust, and that survives a restart — plus the ability to put
static-httpserver in front of a backend that only speaks HTTP.
Certificates
- The self-signed certificate now carries
SubjectAltNameentries (localhost,127.0.0.1,::1,
the hostname and the address it listens on). It previously carried only a CommonName, so it failed
hostname verification in every modern client even when explicitly trusted —curl --cacertand a
trusted browser exception now work instead of only-k. - The certificate is saved to the certificate directory and reused, instead of being regenerated on
every start. It is only replaced when it expires (30 day margin) or stops covering the requested
hosts. If the directory cannot be written it stays in memory, as before. --tls-cert-dirnow defaults to/certsfor root and~/.static-httpserver/certsotherwise, so
an unprivileged process has somewhere to write. The image pinsTLS_CERT_DIR=/certsand ships that
directory owned by the runtime user, so a named volume on/certskeeps the certificate.--tls-cert-file/--tls-key-filefor certificates that do not follow thecert.pem/
key.pemconvention — Let's Encrypt writesfullchain.pemandprivkey.pem. Pointing
--tls-cert-dirat a certbot directory used to fall back to a self-signed certificate silently.--tls-selfsigned-hostsadds names the server cannot discover, such as a public DNS name.
Listeners and proxying
--bind(envBIND_ADDRESS) restricts both listeners to one address.--only-https(envONLY_HTTPS) disables the HTTP listener even when a port is set — the way
to run an HTTPS-only container, since the image setsPORT=8080./is now a valid proxy prefix. It matches every path and strips nothing, so the whole site
can be handed to a backend while static-httpserver terminates TLS:
--proxy /=http://127.0.0.1:3000. Routes are matched most specific first, so a catch-all never
shadows a specific route.- Proxied requests carry
X-Forwarded-ProtoandX-Forwarded-Host. Without them a backend
behind the TLS terminator reportshttp, dropssecurecookies and buildshttp://redirects.
Values set by an upstream proxy are preserved. examples/serve-https.shwraps the local-development case, for use asnpm run serve-https.
Breaking change: the built-in endpoints moved
/health and /headers are now /_health and /_headers, so an application's own
/health is proxied through untouched instead of being shadowed.
Point Kubernetes probes, uptime monitors and load balancer checks at /_health, or restore the old
path with --health-path /health (env HEALTH_PATH). --headers-path does the same for the
headers endpoint. The Helm chart follows parameters.healthPath and defaults to /_health.
Also
- Helm chart 0.3.0 — probes follow
parameters.healthPath. - CI runs
make lintandmake testbefore building the image.
Full changelog: v0.4.0...v0.5.0
v0.4.0
What's Changed
New: Proxy backend TLS configuration
Added two new flags for configuring TLS when proxying to HTTPS backends:
--proxy-ca/PROXY_CA_FILE— CA certificate file (PEM) for verifying backend TLS. Use when the backend uses a private or self-signed CA.--proxy-insecure/PROXY_INSECURE— Skip TLS verification for proxy backends. Use only on trusted internal networks (e.g. WireGuard mesh).
If both are set, --proxy-ca takes precedence.
Example: Hardened OIDC proxy
static-httpserver \
--root-dir /var/www/empty \
--tls-port 443 \
--tls-cert-dir /etc/letsencrypt/live/nimbus.example.com \
--proxy /.well-known/openid-configuration=https://10.106.103.1:8443/.well-known/openid-configuration \
--proxy /keys=https://10.106.103.1:8443/keys \
--proxy /authorize=https://10.106.103.1:8443/authorize \
--proxy /oauth/token=https://10.106.103.1:8443/oauth/token \
--proxy-ca /var/lib/nimbus/ca.crtv0.3.0
What's New
Reverse Proxy Support
The server can now forward requests matching a path prefix to a backend service, useful for:
- Avoiding CORS issues by serving frontend and API from the same origin
- Hiding backend services from direct client access
- Replacing nginx/caddy as a reverse proxy sidecar in Kubernetes
static-httpserver --root-dir ./dist --spa \
--proxy /api=http://backend:3000 \
--proxy /auth=http://auth-service:4000New flags:
--proxy/PROXY_ROUTES— define proxy routes (repeatable flag, comma-separated env)--proxy-timeout/PROXY_TIMEOUT— upstream response timeout in seconds (default: 30)
Other Changes
- Renamed
/api/headersendpoint to/headersto avoid conflicts with proxy routes
v0.2.0
What's New
Complete rewrite of the static HTTP server with major new features.
Server
- Rewritten in modern Go 1.26 with CLI flag support (
--port,--root-dir,--spa, etc.) - HTTPS by default with auto-generated self-signed certificate (custom certs via
--tls-cert-dir) - SPA mode for React/Angular/Vue apps (
--spaorSPA_MODE=true) - In-memory LRU file cache with configurable size limits
/healthendpoint for Kubernetes probes/api/headersendpoint to display request headers (--show-headers)- HTTP server timeouts (read/write/idle) to prevent slowloris attacks
- HTTP is optional — only enabled when
--portorPORTis set
Packaging
- deb/rpm packages available via GoReleaser
- CLI binary for linux/darwin (amd64/arm64)
- Makefile for standardized builds
Docker
- Self-contained parking page — single HTML file, no external dependencies (removed jQuery, Bootstrap 3, Font Awesome 4.7.0)
- Non-root user (appuser, UID 1000)
- Pinned base images (golang:1.26, alpine:3.23)
- Removed
tinyvariant (no longer needed) - Helm chart updated to v0.2.0 with all new parameters
Breaking Changes
--root-dir(orROOT_DIR) is now required--port(orPORT) no longer defaults to 8080 on CLI (Docker image setsPORT=8080via ENV)- Removed
Dockerfile-tinyandbasic/directory