Statiske sites
Servér HTML, CSS, billeder og downloads direkte fra disk. Dette er den enkleste Fluxheim-tilstand.
Hvornår du bruger det
Brug static hosting til dokumentation, produktsider, downloads og sites, der ikke behøver applikationskode på hver request.
- ETag og conditional requests reducerer gentagen trafik.
- Byte ranges virker for større filer.
- Dotfiles bør forblive afvist for public roots.
Static site-eksempel
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
Vigtigste options
| Valg | Brug det når |
|---|---|
root | Du vil have en bounded filesystem root til public files. |
index_files | En mappe bør resolve til en index file. |
deny_dotfiles | Hidden files må aldrig blive public ved et uheld. |
directory_listing | Du publicerer bevidst repository-style file indexes. |
Repository listing-eksempel
[[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.