Статические сайты
Раздавайте HTML, CSS, images и downloads напрямую с диска. Это самый простой режим Fluxheim.
Когда использовать
Используйте static hosting для documentation, product pages, downloads и сайтов, которым не нужен application code на каждый request.
- ETag и conditional requests уменьшают повторный traffic.
- Byte ranges работают для крупных files.
- Dotfiles должны оставаться запрещенными для public roots.
Пример static site
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
Основные options
| Параметр | Используйте, когда |
|---|---|
root | Нужен bounded filesystem root для public files. |
index_files | Directory должен разрешаться в index file. |
deny_dotfiles | Hidden files никогда не должны случайно стать public. |
directory_listing | Вы намеренно публикуете repository-style file indexes. |
Пример repository listing
[[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.