2 min readMar 29, 2026by jakub

Configuration

Trident is configured with a single JSON file, installed by default at /etc/trident/config.json. This page walks through each section of the default configuration.

Default Configuration

JSON
{
  "server": {
    "listeners": [
      { "address": "0.0.0.0:8120" }
    ],
    "timeouts": {
      "connect": "5s",
      "header_read": "10s",
      "body_read": "60s",
      "idle_keepalive": "60s",
      "backend_connect": "5s",
      "backend_first_byte": "60s",
      "backend_between_bytes": "30s"
    },
    "limits": {
      "max_connections": 10000,
      "max_header_size": "32 KiB",
      "max_body_size": "10 MiB",
      "max_uri_length": 8192,
      "max_header_count": 100
    }
  },
  "backends": [
    {
      "name": "origin",
      "host": "127.0.0.1",
      "port": 8080
    }
  ],
  "cache": {
    "enabled": true,
    "max_memory": "1 GiB",
    "grace_period": "60s",
    "stale_while_revalidate": true
  },
  "ttl": {
    "mode": "origin",
    "default": "1h",
    "max": "24h"
  },
  "admin": {
    "enabled": true,
    "address": "127.0.0.1:6085"
  },
  "logging": {
    "level": "info",
    "format": "json"
  }
}

Section Reference

[server]

Defines listeners and protocol settings.

KeyDescription
listenersArray of listener objects with address and optional tls flag

Each listener binds to an address in host:port format. Set tls = true to enable HTTPS on that listener (requires TLS certificate configuration).

[server.timeouts]

Controls timeout durations for client and backend connections.

KeyDefaultDescription
connect5sMaximum time to accept a client connection
header_read10sMaximum time to read request headers
body_read60sMaximum time to read the full request body
idle_keepalive60sHow long to keep idle connections alive
backend_connect5sMaximum time to establish a backend connection
backend_first_byte60sMaximum time to receive the first byte from backend
backend_between_bytes30sMaximum time between bytes from backend

[server.limits]

Resource limits protecting against abuse.

KeyDefaultDescription
max_connections10000Maximum concurrent connections
max_header_size32 KiBMaximum total size of all headers
max_body_size10 MiBMaximum request body size
max_uri_length8192Maximum URI length in bytes
max_header_count100Maximum number of headers

[[backends]]

One or more backend origin servers. Multiple backends enable load balancing.

KeyDescription
nameIdentifier for this backend
hostBackend hostname or IP address
portBackend port number

[cache]

Cache behavior settings.

KeyDefaultDescription
enabledtrueEnable or disable caching
max_memory1 GiBMaximum memory for cached objects
grace_period60sServe stale content for this long after expiry
stale_while_revalidatetrueServe stale content while refreshing in background

[ttl]

Time-to-live settings for cached objects.

KeyDefaultDescription
mode"origin""origin" respects Cache-Control headers; "override" ignores them
default1hDefault TTL when origin doesn't specify one
max24hMaximum TTL cap regardless of origin headers

[admin]

Admin API for cache management, purging, banning, and health checks.

KeyDefaultDescription
enabledtrueEnable or disable the admin API
address127.0.0.1:6085Bind address (keep on localhost for security)

[logging]

KeyDefaultDescription
level"info"Log level: trace, debug, info, warn, error
format"json"Output format: "json" or "text"

Config File Location

PlatformPath
Linux/etc/trident/config.json
FreeBSD/usr/local/etc/trident/config.json

Override with the --config flag:

Bash
trident --config /path/to/config.json

Multi-site Configuration

Use include at the top level to split configuration across files:

JSON
{
  "include": ["sites-enabled/*.json"]
}

This loads all .json files from the sites-enabled/ directory relative to the main config file.

Was this page helpful?
Configuration — Trident HTTP Cache Proxy | qoliber Docs