imgFlux reads configuration exclusively from environment variables. This document expands on every tunable option, providing context, defaults, and usage notes. Combine it with infrastructure-specific techniques (dotenv files, container orchestrator secrets, etc.) to inject settings at runtime.
Maximum number of simultaneous image-processing jobs. 0 lets imgFlux set num_cpus * 2. Increase if graphicsmagick operations are lightweight; decrease on memory-constrained hosts.
IMGFLUX_TIMEOUT
30 seconds
Hard timeout enforced by the request-timeout middleware. Requests exceeding the budget return 504 Gateway Timeout. Tune alongside upstream proxy timeouts.
IMGFLUX_DOWNLOAD_TIMEOUT
10 seconds
Client-side timeout for fetching the source image. Slow origins trigger an error when exceeded.
IMGFLUX_RATE_LIMIT_PER_MINUTE
unset
Enables a token bucket limiter shared by all requests. Use it to shield downstream origins. Set to 0 or leave unset to disable.
Hex-encoded HMAC key. The decoded byte string is used to sign URLs (see URL Structure). Minimum 32 bytes recommended.
IMGFLUX_SALT
required
Hex-encoded salt prepended to the signed path prior to hashing. Rotate alongside the key.
IMGFLUX_ALLOW_UNSIGNED
false
When true, accepts unsafe/... paths without signature validation. Restrict to development environments.
IMGFLUX_SECRET
unset
If provided, requests to /info and image endpoints must include Authorization: Bearer <token>. Combine with load balancer ACLs when exposing imgFlux publicly.
IMGFLUX_ALLOW_SECURITY_OPTIONS
false
Permits request-level overrides of file size and resolution limits. Keep disabled unless you trust all URL builders.
Caching is optional but highly recommended for hot content. Enable it via IMGFLUX_CACHE_TYPE and allied variables. Full guidance lives in Cache Configuration. At a glance:
Variable
Default
Description
IMGFLUX_CACHE_TYPE
unset
Choose memory, disk, or hybrid.
IMGFLUX_CACHE_MEMORY_CAPACITY
1000
Maximum number of entries stored in memory.
IMGFLUX_CACHE_DISK_PATH
required for disk/hybrid
Directory for on-disk storage. Must be writable and persistent.
Presets are named sets of processing options that can be reused across multiple requests, simplifying URL management and enforcing consistency.
Variable
Default
Description & tips
IMGFLUX_PRESETS
unset
Comma-separated preset definitions in the format name=options. Options use / as separator and follow standard processing option syntax (e.g., thumbnail=trim:150:150q80,banner=ex:1200:300q90). A preset named default applies to all requests.
IMGFLUX_ONLY_PRESETS
false
When true, enables presets-only mode. Only preset:name (or pr:name) references are allowed in URLs; other processing options are rejected. Use this to enforce strict governance over transformations.
Dotenv files: Store variables in .env and load them with dotenvx or direnv. Keep files out of version control.
Container orchestrators: Map secrets to environment variables. For Kubernetes, use envFrom with ConfigMaps (non-secret) and Secrets (sensitive values).
Systemd: Place variables in /etc/imgFlux.env and reference them via EnvironmentFile= in the unit. See Deployment.