Fluxheim/Dokumentacja/Strony statyczne

Strony statyczne

Serwuj HTML, CSS, obrazy i download bezpośrednio z dysku. To najprostszy tryb Fluxheim.

Kiedy używać

Użyj static hosting dla dokumentacji, product pages, downloadów i stron, które nie potrzebują application code przy każdym request.

  • ETag i conditional requests zmniejszają powtarzalny traffic.
  • Byte ranges działają dla większych plików.
  • Dotfile powinny pozostać zablokowane dla public roots.

Przykład static site

[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]

[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true

Główne opcje

OpcjaUżyj, gdy
rootChcesz bounded filesystem root dla public files.
index_filesDirectory powinien rozwiązywać się do index file.
deny_dotfilesHidden files nigdy nie mogą przypadkowo stać się publiczne.
directory_listingCelowo publikujesz repository-style file indexes.

Przykład 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.

Polski