Skip to main content

Module server_config

Module server_config 

Source
Expand description

Production HTTP serving configuration — the NGINX-equivalent surface.

Apps can load this from config/anvil.toml via ServerConfig::from_file, or build it programmatically via the typed structs. Env vars override file values where applicable (Laravel-style precedence).

Structs§

AccessLogConfig
AcmeConfig
BasicAuthRule
CompressionConfig
CorsConfig
HstsConfig
IpRule
LimitsConfig
ProxyRule
RateLimitConfig
RedirectHttpConfig
RewriteRule
RouteTimeoutRule
ServerConfig
SniCertEntry
StaticMount
TlsConfig
TrailingSlashConfig
TrustedProxiesConfig

Enums§

AccessLogFormat
IpAction
TrailingSlashAction
TrailingSlashMode

Functions§

parse_duration
Parse "30s", "5m", "1h", "1d", "1y", or a bare integer (seconds). Bare unit strings like "m" (without a count) are interpreted as "1m" so rate-limit specs like "5/m" parse cleanly.
parse_rate
Parse "60/minute" → (count, window).
parse_size
Parse "10MB", "500KB", "2GB", or a bare integer (bytes).