Front your webserver containers with a transparent cache.
This image runs an nginx server as a caching reverse proxy for a given URL. It can be used in conjunction with Traefik in order to transparently cache chosen paths on a backend service.
The container needs two environment variables:
UPSTREAM
: URL of the upstream service which should be cachedALLOWED_ORIGIN
: origin URL which is allowed to load the files from this server (headerAccess-Control-Allowed-Origins
) (default*
)MAX_SIZE
: Size of the cache to use (on-disk)MAX_INACTIVE
: Maximum inactive time for cached items (default: 60m)GZIP
: Set tooff
in order to disable gzip compression (enabled by default)PROXY_READ_TIMEOUT
: Set the timeout for reading a response from the proxied server (default: 120s)PROXY_CACHE_VALID
: Set caching time for 200, 301, and 302 responses (disabled by default)
The server will be listening on port 80.
See the supplied docker-compose.yml for an example.