Skip to main content

Module config

Module config 

Source
Expand description

TOML configuration loading.

A ServerConfig mirrors the TOML file the CLI accepts. It can also be turned directly into a runnable Server when a runtime feature is enabled.

listen = "0.0.0.0:8080"      # or ["127.0.0.1:8080", "[::1]:8080"]
root = "/var/www"            # document root for static file serving
server_name = "httpsd"
workers = 8

[tls]
cert = "cert.pem"            # PEM chain (leaf first)
key = "key.pem"              # PEM private key
# self_signed = ["localhost"]  # alternatively, generate an ephemeral cert

[compress]
enabled = true
min_size = 256

Structs§

AcmeFileConfig
Automatic-certificate (ACME) settings.
CompressConfig
Compression settings.
HstsConfig
Strict-Transport-Security settings.
PrivDropConfig
Privilege-dropping settings (drop root after binding; Unix only).
ServerConfig
The parsed server configuration.
TlsConfig
TLS settings.