Skip to main content

HTTP configuration

[http]​

The web-facing layers in front of the API: forwarded-field trust, Link layout, body decoding, CORS, compression, Server-Timing, security headers and CSRF.
[http]
link_field = "combined"
stringrestart to apply

How the Link values of a response or an HTTP notification are spread over field lines. All layouts mean the same; pick the one your clients read.

Default
"combined"
Allowed values
"combined"Puts every Link value on one field line, separated by commas, for clients that read only one field line.
"grouped"Gives the @context link, the pagination links and any other values a field line each.
"separate"Gives every Link value its own field line, for clients that never split a line on commas.
Environment variable
ANDROMEDA__HTTP__LINK_FIELD

[http.body_decoding]​

Where request bodies are parsed: on the request's own worker or on a separate thread pool.
[http.body_decoding]
blocking_threshold = "256 KiB"
max_concurrent_blocking = 4

http.body_decoding.blocking_threshold​

sizerestart to apply

The body size from which a body is parsed on a separate thread pool instead of the request's own worker, so a large body does not stall unrelated requests sharing that worker.

Default
"256 KiB"
Also required
  • It must fit the platform's address width.
Environment variable
ANDROMEDA__HTTP__BODY_DECODING__BLOCKING_THRESHOLD

http.body_decoding.max_concurrent_blocking​

positive integerrestart to apply

How many large bodies are parsed on the separate thread pool at once. A parse holds memory in proportion to its body while it runs; a body waiting for its turn holds only its bytes.

Default
4
Must be
0 < max_concurrent_blocking
Environment variable
ANDROMEDA__HTTP__BODY_DECODING__MAX_CONCURRENT_BLOCKING

[http.cors]​

The Cross-Origin Resource Sharing policy browser clients see.
[http.cors]
mode = "permissive"
allow_origins = "any"
allow_methods = "any"
allow_headers = "any"
expose_headers = []
credentials = "refused"
private_network = "refused"
# preflight_lifetime = "10m"

http.cors.mode​

stringrestart to apply

Which CORS policy applies. Only "configured" reads the other keys of this table. "permissive" by default, so a browser-based interface works against the broker from any origin, and since it allows no credentials a page cannot act with a user's cookies; set "configured" to name the origins a deployment serves.

Default
"permissive"
Allowed values
"disabled"Adds no CORS headers.
"permissive"Allows any origin, method and header, without credentials. Every other [http.cors] key is ignored.
"very-permissive"Mirrors the request's origin, method and headers, and allows credentials. Every other [http.cors] key is ignored.
Also required
Environment variable
ANDROMEDA__HTTP__CORS__MODE

http.cors.allow_origins​

string or list of URLrestart to apply

The origins allowed to read the API: "any", or a list such as ["https://dashboard.example.org"]. Read only when http.cors.mode is "configured".

Default
"any"
Allowed values
"any"Accepts requests from any origin.
Also required
Environment variable
ANDROMEDA__HTTP__CORS__ALLOW_ORIGINS

http.cors.allow_methods​

string or list of stringrestart to apply

The methods allowed: "any", "mirror" to allow whatever the preflight asks for, or a list such as ["GET", "POST"]. Read only when http.cors.mode is "configured".

Default
"any"
Allowed values
"any"Allows any method.
"mirror"Allows the method the request asks for.
Also required
Environment variable
ANDROMEDA__HTTP__CORS__ALLOW_METHODS

http.cors.allow_headers​

string or list of stringrestart to apply

The request headers allowed: "any", "mirror" to allow whatever the preflight asks for, or a list of header names. Read only when http.cors.mode is "configured".

Default
"any"
Allowed values
"any"Allows any request header.
"mirror"Allows the headers the request asks for.
Also required
Environment variable
ANDROMEDA__HTTP__CORS__ALLOW_HEADERS

http.cors.expose_headers​

string or list of stringrestart to apply

The response headers a browser script may read: "any", or a list of header names. Read only when http.cors.mode is "configured".

Default
[]
Allowed values
"any"Exposes any response header.
Also required
Environment variable
ANDROMEDA__HTTP__CORS__EXPOSE_HEADERS

http.cors.credentials​

stringrestart to apply

Whether cookies and HTTP authentication may accompany a cross-origin request. Read only when http.cors.mode is "configured".

Default
"refused"
Allowed values
"allowed"Grants it.
"refused"Refuses it.
Also required
Environment variable
ANDROMEDA__HTTP__CORS__CREDENTIALS

http.cors.private_network​

stringrestart to apply

Whether a private-network preflight is answered with Access-Control-Allow-Private-Network. Read only when http.cors.mode is "configured".

Default
"refused"
Allowed values
"allowed"Grants it.
"refused"Refuses it.
Environment variable
ANDROMEDA__HTTP__CORS__PRIVATE_NETWORK

http.cors.preflight_lifetime​

durationrestart to apply

How long a browser may cache a preflight answer, sent as Access-Control-Max-Age. Left out, the broker sends no Access-Control-Max-Age and the browser's own default applies. Read only when http.cors.mode is "configured".

Default
Not set. Example: "10m"
Environment variable
ANDROMEDA__HTTP__CORS__PREFLIGHT_LIFETIME

[http.compression]​

Which codings responses may be compressed with, and how hard.
[http.compression]
mode = "enabled"
algorithms = ["gzip", "brotli", "deflate", "zstd"]
quality = "default"

http.compression.mode​

stringrestart to apply

Whether responses are compressed. Turn it off when a proxy in front compresses them.

Default
"enabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Also required
Environment variable
ANDROMEDA__HTTP__COMPRESSION__MODE

http.compression.algorithms​

list of stringrestart to apply

The codings responses may be compressed with, chosen against the client's Accept-Encoding. Read only when http.compression.mode is "enabled".

Default
["gzip", "brotli", "deflate", "zstd"]
Also required
Environment variable
ANDROMEDA__HTTP__COMPRESSION__ALGORITHMS

http.compression.quality​

stringrestart to apply

How hard the compressor works.

Default
"default"
Allowed values
"fastest"Favours speed over compression ratio.
"best"Favours compression ratio over speed.
"default"Uses each coding's own balance of speed and ratio.
Environment variable
ANDROMEDA__HTTP__COMPRESSION__QUALITY

[http.decompression]​

Which codings a request body may arrive in.
[http.decompression]
mode = "enabled"
algorithms = ["gzip", "brotli", "deflate", "zstd"]
unaccepted_encoding = "refused"

http.decompression.algorithms​

list of stringrestart to apply

The codings a request body may arrive in, decoded before the body is read. Read only when http.decompression.mode is "enabled".

Default
["gzip", "brotli", "deflate", "zstd"]
Also required
Environment variable
ANDROMEDA__HTTP__DECOMPRESSION__ALGORITHMS

http.decompression.unaccepted_encoding​

stringrestart to apply

What happens to a body in a coding that is not listed. Read only when http.decompression.mode is "enabled".

Default
"refused"
Allowed values
"refused"Answers the request 415 Unsupported Media Type.
"allowed"Passes the body on still encoded.
Environment variable
ANDROMEDA__HTTP__DECOMPRESSION__UNACCEPTED_ENCODING

[http.forwarded]​

Whose Forwarded, X-Forwarded-Proto and X-Forwarded-Host fields decide the scheme and host of the URLs the broker builds. Believe them only from a reverse proxy that overwrites them.
[http.forwarded]
trust = "none"
proxies = []

http.forwarded.trust​

stringrestart to apply

Whose forwarded fields the broker believes.

Default
"none"
Allowed values
"none"Ignores the fields. The URLs the broker builds carry the scheme its own listener speaks and the host the request addressed.
"any"Believes the fields from every peer. Set it only when nothing but a reverse proxy that overwrites the fields can reach the broker, or any client chooses the scheme and host of the URLs the broker builds, including the stored URL of an @context it serves to later readers.
"proxies"Believes the fields only from a peer http.forwarded.proxies lists, and ignores them from every other peer. Each listed proxy must overwrite the fields rather than append to them.
Also required
Environment variable
ANDROMEDA__HTTP__FORWARDED__TRUST

http.forwarded.proxies​

list of stringrestart to apply

The IP addresses and subnets ("10.0.0.0/8", "192.0.2.7", "fd00::/8") of the proxies whose forwarded fields are believed, matched against the address a request arrives from. An IPv4 peer reaching a dual-stack listener is matched as its IPv4 address.

Default
[]
Also required
Environment variable
ANDROMEDA__HTTP__FORWARDED__PROXIES

[http.server_timing]​

Whether responses carry a Server-Timing header, and what it reports.
[http.server_timing]
mode = "enabled"
phases = ["total"]

http.server_timing.mode​

stringrestart to apply

Whether responses carry a Server-Timing header.

Default
"enabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Environment variable
ANDROMEDA__HTTP__SERVER_TIMING__MODE

http.server_timing.phases​

list of stringrestart to apply

Which times the header reports.

Default
["total"]
Environment variable
ANDROMEDA__HTTP__SERVER_TIMING__PHASES

[http.security_headers]​

The security headers API responses carry, each set or turned off on its own.
[http.security_headers]
mode = "enabled"
cross_origin_opener_policy = "same-origin"
cross_origin_resource_policy = "same-origin"
origin_agent_cluster = "origin-keyed"
referrer_policy = "no-referrer"
x_content_type_options = "nosniff"
x_dns_prefetch_control = "off"
x_download_options = "noopen"
x_frame_options = "same-origin"
x_permitted_cross_domain_policies = "none"
x_xss_protection = "off"

http.security_headers.mode​

stringrestart to apply

Whether API responses carry the security headers below. Turn it off when a proxy in front sets them all; to drop one header, set its own key to "disabled".

Default
"enabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__MODE

http.security_headers.cross_origin_opener_policy​

stringrestart to apply

The Cross-Origin-Opener-Policy header.

Default
"same-origin"
Allowed values
"same-origin"Sends same-origin.
"same-origin-allow-popups"Sends same-origin-allow-popups.
"unsafe-none"Sends unsafe-none.
"disabled"Sends no Cross-Origin-Opener-Policy header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__CROSS_ORIGIN_OPENER_POLICY

http.security_headers.cross_origin_resource_policy​

stringrestart to apply

The Cross-Origin-Resource-Policy header.

Default
"same-origin"
Allowed values
"same-origin"Sends same-origin.
"same-site"Sends same-site.
"cross-origin"Sends cross-origin.
"disabled"Sends no Cross-Origin-Resource-Policy header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__CROSS_ORIGIN_RESOURCE_POLICY

http.security_headers.origin_agent_cluster​

stringrestart to apply

The Origin-Agent-Cluster header.

Default
"origin-keyed"
Allowed values
"origin-keyed"Sends ?1, asking the browser to isolate the broker's origin.
"site-keyed"Sends ?0, letting the browser share an agent cluster across the site.
"disabled"Sends no Origin-Agent-Cluster header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__ORIGIN_AGENT_CLUSTER

http.security_headers.referrer_policy​

stringrestart to apply

The Referrer-Policy header.

Default
"no-referrer"
Allowed values
"no-referrer"Sends no-referrer.
"no-referrer-when-downgrade"Sends no-referrer-when-downgrade.
"origin"Sends origin.
"origin-when-cross-origin"Sends origin-when-cross-origin.
"same-origin"Sends same-origin.
"strict-origin"Sends strict-origin.
"strict-origin-when-cross-origin"Sends strict-origin-when-cross-origin.
"unsafe-url"Sends unsafe-url.
"disabled"Sends no Referrer-Policy header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__REFERRER_POLICY

http.security_headers.x_content_type_options​

stringrestart to apply

The X-Content-Type-Options header.

Default
"nosniff"
Allowed values
"nosniff"Sends nosniff.
"disabled"Sends no X-Content-Type-Options header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__X_CONTENT_TYPE_OPTIONS

http.security_headers.x_dns_prefetch_control​

stringrestart to apply

The X-DNS-Prefetch-Control header.

Default
"off"
Allowed values
"off"Sends off.
"on"Sends on.
"disabled"Sends no X-DNS-Prefetch-Control header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__X_DNS_PREFETCH_CONTROL

http.security_headers.x_download_options​

stringrestart to apply

The X-Download-Options header.

Default
"noopen"
Allowed values
"noopen"Sends noopen.
"disabled"Sends no X-Download-Options header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__X_DOWNLOAD_OPTIONS

http.security_headers.x_frame_options​

stringrestart to apply

The X-Frame-Options header.

Default
"same-origin"
Allowed values
"same-origin"Sends SAMEORIGIN.
"deny"Sends DENY.
"disabled"Sends no X-Frame-Options header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__X_FRAME_OPTIONS

http.security_headers.x_permitted_cross_domain_policies​

stringrestart to apply

The X-Permitted-Cross-Domain-Policies header.

Default
"none"
Allowed values
"none"Sends none.
"master-only"Sends master-only.
"by-content-type"Sends by-content-type.
"by-ftp-filename"Sends by-ftp-filename.
"all"Sends all.
"disabled"Sends no X-Permitted-Cross-Domain-Policies header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__X_PERMITTED_CROSS_DOMAIN_POLICIES

http.security_headers.x_xss_protection​

stringrestart to apply

The X-XSS-Protection header.

Default
"off"
Allowed values
"off"Sends 0, turning a browser's XSS filter off.
"on"Sends 1.
"block"Sends 1; mode=block.
"disabled"Sends no X-XSS-Protection header.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__X_XSS_PROTECTION

[http.security_headers.content_security_policy]​

The Content-Security-Policy header.
[http.security_headers.content_security_policy]
mode = "enabled"
policy = "default-src 'self'; base-uri 'self'; font-src 'self' https: data:; form-action 'self'; frame-ancestors 'self'; img-src 'self' data:; object-src 'none'; script-src 'self'; script-src-attr 'none'; style-src 'self' https: 'unsafe-inline'; upgrade-insecure-requests"

http.security_headers.content_security_policy.mode​

stringrestart to apply

Whether API responses carry a Content-Security-Policy header.

Default
"enabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__CONTENT_SECURITY_POLICY__MODE

http.security_headers.content_security_policy.policy​

stringrestart to apply

The policy the header carries.

Default
"default-src 'self'; base-uri 'self'; font-src 'self' https: data:; form-action 'self'; frame-ancestors 'self'; img-src 'self' data:; object-src 'none'; script-src 'self'; script-src-attr 'none'; style-src 'self' https: 'unsafe-inline'; upgrade-insecure-requests"
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__CONTENT_SECURITY_POLICY__POLICY

[http.security_headers.strict_transport_security]​

The Strict-Transport-Security header, sent only on a response to a request that arrived over the TLS listener.
[http.security_headers.strict_transport_security]
mode = "disabled"
max_age = "180days"
include_subdomains = "disabled"

http.security_headers.strict_transport_security.mode​

stringrestart to apply

Whether a response to a request over the TLS listener carries Strict-Transport-Security. A browser that sees it uses HTTPS for the host until max_age passes. Off by default, since a browser that has seen it cannot reach the host over plain HTTP again until then; turn it on once HTTPS is the only way the host is reached.

Default
"disabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__STRICT_TRANSPORT_SECURITY__MODE

http.security_headers.strict_transport_security.max_age​

durationrestart to apply

How long a browser keeps using HTTPS for the host, the header's max-age. Zero tells a browser to forget the host.

Default
"180days"
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__STRICT_TRANSPORT_SECURITY__MAX_AGE

http.security_headers.strict_transport_security.include_subdomains​

stringrestart to apply

Whether the policy also covers every subdomain of the host, the header's includeSubDomains.

Default
"disabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Environment variable
ANDROMEDA__HTTP__SECURITY_HEADERS__STRICT_TRANSPORT_SECURITY__INCLUDE_SUBDOMAINS

[http.csrf]​

Cross-Site Request Forgery protection for browser clients.
[http.csrf]
mode = "disabled"
trusted_origins = []

http.csrf.mode​

stringrestart to apply

Whether a cross-site request from an origin outside http.csrf.trusted_origins is answered 403. Same-origin requests, requests with neither Origin nor Sec-Fetch-Site, and GET, HEAD and OPTIONS always go through. Off by default, since the broker itself authenticates no one. Turn it on when a proxy in front authenticates browsers, by cookie or by HTTP authentication, because a forged cross-site request would then carry the user's credentials.

Default
"disabled"
Allowed values
"disabled"Turn the feature off.
"enabled"Turn the feature on.
Environment variable
ANDROMEDA__HTTP__CSRF__MODE

http.csrf.trusted_origins​

list of URLrestart to apply

The browser origins whose cross-site requests are trusted, in addition to same-origin requests.

Default
[]
Environment variable
ANDROMEDA__HTTP__CSRF__TRUSTED_ORIGINS