index : static-web-server.git

ascending towards madness

# Address & Root dir
host = "::"
port = 80
root = "./public"

# Logging
log-level = "error"

# Cache Control headers
cache-control-headers = true

# Auto Compression
compression = true

# Error pages
page404 = "404.html"
page50x = "50x.html"

# HTTP/2 + TLS
http2 = true
http2-tls-cert = ""
http2-tls-key = ""

# CORS & Security headers
security-headers = true
cors-allow-origins = ""

# Directoy listing
directory-listing = false

# Basich Authentication
basic-auth = ""

# File descriptor binding
# fd = ""

# Worker threads
threads-multiplier = 1

# Grace period after a graceful shutdown
grace-period = 0

# Page fallback for 404s
page-fallback = ""

# HTTP Headers customization

# a. Online version
[[headers]]
source = "**/*.@(eot|otf|ttf|ttc|woff|font.css)"
headers = { Access-Control-Allow-Origin = "*", X-XSS-PROTECTION = "1; mode=block" }

# b. Multiline version
[[headers]]
  source = "**/*.@(jpg|jpeg|gif|png)"
[headers.headers]
  Cache-Control = "max-age=7200"
  Content-Security-Policy = "frame-ancestors 'self'"

# c. Multiline version with explicit key (dotted)
[[headers]]
source = "404.html"
headers.Cache-Control = "max-age=300"
headers.Strict-Transport-Security = "max-age=63072000; includeSubDomains; preload"