Skip to main content

Configuration

Every directive goes in the server configuration, outside a <Location>. A virtual host may set its own, and a virtual host that sets none starts from the defaults rather than inheriting from the main server.

PageDirectives
Clientswho may ask, and for how long
Image sourceswhere an image may come from
Cache controlwhat the response says about caching
Outputwhat the response contains
Resourceswhat a request may consume

A basic configuration

LoadModule dims_module modules/libmod_dims.so

DimsSigningKey a-long-random-string

<Location /dims5/>
SetHandler dims5
</Location>

Hardening

The shipped conf/mod_dims.conf.example sets these. Each is safe to relax when your deployment needs it.

  • DimsMaxSourceBytes caps the source size, so one request cannot exhaust memory. A malicious SVG is bounded by this too.
  • DimsAllowPrivateAddresses off refuses a fetch to an internal address. The cloud metadata address is refused whatever this holds.
  • DimsStatusVerbose off drops the component versions from the status page, so it does not name the libraries a caller would target. Restrict the /dims-status/ location to your monitoring host as well.
  • DimsEncryptionAlgorithm AES/GCM/NoPadding decrypts the eurl parameter with an authenticated cipher. The client that builds an eurl must encrypt with the same.

Two more are worth enabling as your deployment allows.

  • DimsAllowlistSigned enforce holds a signed request to the allowlist. A signed request skips it by default. Enable it once the allowlist covers your origins.
  • Prefer /dims5/ for a new integration. It signs with HMAC-SHA256.

Every directive

DirectiveDefault
DimsAddClientnone
DimsAddWhitelistempty
DimsAllowPrivateAddressesOn
DimsAllowlistSignedlog
DimsAnimatedImagespassthrough
DimsCacheExpire86400
DimsDefaultImagePrefixnone
DimsDefaultImageURLnone
DimsDefaultOutputFormatnone
DimsDisableEncodedFetch0
DimsDownloadTimeout3000
DimsEncryptionAlgorithmAES/ECB/PKCS5Padding
DimsErrorBackgroundnone
DimsIgnoreDefaultOutputFormatnone
DimsImagemagickAreaSize128
DimsImagemagickDiskSize2048
DimsImagemagickMapSize1024
DimsImagemagickMemorySize512
DimsImagemagickTimeout3000
DimsIncludeDispositionfalse
DimsMaxSourceBytes0
DimsNoImageCacheExpire60
DimsOptimizeResize0
DimsOriginStatusModeforward
DimsOverlayCacheMaxAge86400
DimsOverlayCacheMaxEntries1024
DimsProfileDirshare/mod_dims/profiles
DimsSecretMaxExpiryPeriod0
DimsSigningKeynone
DimsStatusVerboseOn
DimsStripMetadatatrue
DimsUserAgentEnabledfalse
DimsUserAgentOverridenone