Διαμόρφωσηuration Basics
Το Fluxheim χρησιμοποιεί TOML. Άγνωστα fields απορρίπτονται, οπότε τα ορθογραφικά λάθη αποτυγχάνουν πριν το restart.
Κύρια μορφή
[server]
listen = ["0.0.0.0:8080"]
default_vhost = "site"
[[vhosts]]
name = "site"
hosts = ["example.com"]
Πώς οργανώνεται το config
| Περιοχή | Τι ανήκει εκεί |
|---|---|
server | Listeners, global limits, trusted proxy handling, and redirects. |
tls | Global TLS backend και compatibility policy. |
cache | Process-wide cache defaults and storage tiers. |
vhosts | Hostnames, routes, web roots, proxy settings, PHP, TLS, and access policy. |
metrics | Prometheus και export listeners για operational visibility. |
Μορφή route
[[vhosts.routes]]
name = "app"
path_prefix = "/app/"
methods = ["GET", "HEAD", "POST"]
max_request_body_bytes = "16MiB"
[vhosts.routes.proxy]
upstreams = ["127.0.0.1:3000"]
Ένα route έχει έναν matcher και μία action. Exact paths κερδίζουν πρώτα, μετά longest prefixes, μετά regex routes όταν ενεργοποιείται regex support, και μετά ένα fallback route.
Ασφαλείς συνήθειες
- Εκτέλεση
fluxheim --check-configπριν τα reloads. - Χρησιμοποίησε ένα vhost ανά site ή application boundary.
- Κράτα secrets σε files, environment ή container secrets, όχι σε public docs.
- Χρησιμοποίησε route-level limits για uploads και ακριβά application paths.
- Κράτα admin και metrics listeners private.