Skip to main content

Configuration reference

Options go under the plugin name queuemanager in the middleware configuration:

  • Docker labels: traefik.http.middlewares.<name>.plugin.queuemanager.<option>=<value>
  • File provider: http.middlewares.<name>.plugin.queuemanager.<option>

Values are checked when Traefik creates the middleware. A value that fails a check stops the middleware with invalid QueueManager configuration: <reason>.

Queue​

OptionTypeDefaultCheckDescription
enabledbooltruefalse lets every request through, without queue or rate limit
maxEntriesint100> 0Number of visitors allowed in at the same time
inactivityTimeoutSecondsint60> 0An active visitor without a request for this long loses the slot
hardSessionLimitSecondsint0≥ 0Maximum time in the service, counted from entry or from the exit of the queue. 0 turns it off
cleanupIntervalSecondsint30> 0Interval between two cleanups: removal of expired visitors, entry of the head of the queue

The queue is always first in, first out. The queueStrategy option exists, with fifo as its only value.

Waiting page​

OptionTypeDefaultCheckDescription
queuePageFilestring/var/public/queue-page.htmlnot emptyHTML template of the waiting page. Missing or invalid: built-in English page
queueTranslationsFilestring/var/public/translations.jsonTexts of the page per language. Missing: empty texts
refreshIntervalSecondsint20> 0Reload interval of the waiting page, in seconds
minWaitTimeMinutesint1Floor of the wait time shown, in minutes
httpResponseCodeint429Status of the waiting page, the JSON response and the rate limit response
httpContentTypestringtext/html; charset=utf-8Content-Type of the waiting page

Visitor identification​

OptionTypeDefaultCheckDescription
useCookiesbooltruetrue: random cookie. false: SHA-256 hash of the client IP and User-Agent
cookieNamestringloch-queue-idName of the cookie, also checked by the rate limit
cookieMaxAgeSecondsint3600Lifetime of the cookie, not renewed
rateLimitTimesint5Requests without the cookie allowed per IP and per minute. 0 refuses every request without the cookie

The cookie holds 16 random bytes in hexadecimal, with Path=/, HttpOnly, SameSite=Lax, and Secure when the TLS connection ends at Traefik.

Logs​

OptionTypeDefaultCheckDescription
logLevelstringinfodebug, info, warn or error
debugboolfalseForces the debug level and fills DebugInfo on the waiting page and in the JSON response
logFilestringemptyFile to append the logs to. Empty: Traefik standard error. If the file cannot be opened, standard error is used

Full example​

dynamic.yml
http:
middlewares:
queue:
plugin:
queuemanager:
enabled: true
maxEntries: 300
inactivityTimeoutSeconds: 300
hardSessionLimitSeconds: 3600
cleanupIntervalSeconds: 30
refreshIntervalSeconds: 20
minWaitTimeMinutes: 1
queuePageFile: /var/public/queue-page.html
queueTranslationsFile: /var/public/translations.json
httpResponseCode: 429
useCookies: true
cookieName: loch-queue-id
cookieMaxAgeSeconds: 7200
rateLimitTimes: 5
logLevel: warn