Octopus
1.x
Docs/Octopus/Gateway
Open

Reading3 min
Updated31 Jul 2026
Sourcev1/configuration/gateway.mdx

Gateway

The gateway section configures the listener and connection-level behavior. It is the only required top-level section, and listen is the only required field within it.

gateway:
  listen: "0.0.0.0:8080"
  workers: 0
  request_timeout: 30s
  shutdown_timeout: 30s
  pre_stop_delay: 5s
  max_body_size: 10485760
  internal_route_prefix: "__"
  enforce_sni_check: true

gateway01

KeyTypeDefaultDescription
listensocket addressAddress and port to bind, e.g. 0.0.0.0:8080. Required.
workersinteger0Worker threads. 0 means auto (derive from CPUs).
request_timeoutduration30sPer-request timeout. Must be greater than zero.
shutdown_timeoutduration30sGraceful shutdown window to drain in-flight requests.
pre_stop_delayduration5sDelay after SIGTERM before the listener stops accepting new connections. Gives Kubernetes time to mark the pod NotReady. Set to 0s to disable (e.g. when a preStop hook owns the delay).
max_body_sizeinteger (bytes)10485760 (10 MiB)Maximum request body size. Must be greater than zero.
tlsobjectnoneTLS listener configuration. See TLS.
compressionobjectenabledResponse compression. See below.
internal_route_prefixstring"__"Prefix for built-in internal endpoints (admin, metrics, FARP), e.g. /__admin, /__metrics.
probesobjectenabledKubernetes-style health probe endpoints. See below.
enforce_sni_checkbooleantrueReject requests whose Host / :authority disagrees with the negotiated TLS SNI (anti host-spoofing). Disable when TLS is terminated upstream or Host legitimately differs from the SNI.
security_headersobjectdisabledSecurity response headers (HSTS, CSP, X-Frame-Options, …). See below.
Note

pre_stop_delay and enforce_sni_check are most relevant in Kubernetes and TLS deployments respectively. See Kubernetes and Security for the operational background.

Probes02

The gateway.probes object controls the health endpoints served on the gateway's listen port, intended for Kubernetes liveness/readiness/startup probes and external load-balancer checks.

gateway:
  listen: "0.0.0.0:8080"
  probes:
    enabled: true
    liveness_path: /livez
    readiness_path: /readyz
    startup_path: /startupz
    require_discovery_sync: true
KeyTypeDefaultDescription
enabledbooleantrueWhether the probe endpoints are served.
liveness_pathstring/livezReturns 200 while the process is alive.
readiness_pathstring/readyzReturns 200 only when ready to serve new traffic.
startup_pathstring/startupzReturns 200 once the listener has bound.
require_discovery_syncbooleantrueWhen true, readiness waits for the first service-discovery sync (only applies when discovery is configured).

Compression03

The gateway.compression object configures response compression. It is enabled by default and is the global compression middleware in the request pipeline (see Middleware).

gateway:
  listen: "0.0.0.0:8080"
  compression:
    enabled: true
    level: 6
    min_size: 1024
    algorithms: ["br", "zstd", "gzip"]
KeyTypeDefaultDescription
enabledbooleantrueEnable response compression.
levelinteger6Compression level (1–9 for gzip/zstd, 1–11 for brotli).
min_sizeinteger (bytes)1024Minimum response size before compression is applied.
algorithmsarray of string["br", "zstd", "gzip"]Preferred algorithms in order of preference. Valid values: br (brotli), zstd, gzip.

Security headers04

The gateway.security_headers object adds common security headers to every response via the security-headers middleware. It is disabled by default; set enabled: true to turn it on. Each header is emitted only when its value is set (set a field to null to omit it); the defaults below apply when enabled without overrides.

gateway:
  listen: "0.0.0.0:8080"
  security_headers:
    enabled: true
    frame_options: DENY
    content_type_options: nosniff
    referrer_policy: strict-origin-when-cross-origin
    # hsts, csp, xss_protection, permissions_policy are also supported
KeyTypeDefaultDescription
enabledbooleanfalseAdd the configured security headers to every response.
hstsstringmax-age=31536000; includeSubDomainsStrict-Transport-Security value.
cspstringdefault-src 'self'Content-Security-Policy value.
frame_optionsstringDENYX-Frame-Options value.
content_type_optionsstringnosniffX-Content-Type-Options value.
xss_protectionstring1; mode=blockX-XSS-Protection value.
referrer_policystringstrict-origin-when-cross-originReferrer-Policy value.
permissions_policystringnonePermissions-Policy value.