Statické weby
Servíruj HTML, CSS, obrázky a download priamo z disku. Toto je najjednoduchší režim Fluxheim.
Kedy použiť
Použi statický hosting pre dokumentáciu, product pages, download a site, ktoré nepotrebujú application code pre každý request.
- ETag a conditional request znižujú opakovaný traffic.
- Byte ranges fungujú pre väčšie file.
- Dotfile musia zostať zakázané vo verejných root.
Príklad statického site
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
Hlavné voľby
| Volba | Použi, keď |
|---|---|
root | Chceš bounded filesystem root pre public file. |
index_files | Directory sa má vyřešit na index file. |
deny_dotfiles | Hidden file sa nikdy nemajú omylom stať public. |
directory_listing | Záměrně publikuješ repository-style file index. |
Repository listing príklad
[[vhosts.routes]]
name = "repo"
path_prefix = "/repo/"
[vhosts.routes.web]
root = "/srv/repository/public"
index_files = ["index.html"]
[vhosts.routes.web.directory_listing]
enabled = true
exact_size = false
Directory listings stay private-cache by default, skip symlink entries, and still prefer index files when they exist.