静的サイト

HTML、CSS、画像、ダウンロードをディスクから直接配信します。これはFluxheimの最も単純なモードです。

使う場面

ドキュメント、製品ページ、ダウンロード、リクエストごとのアプリケーションコードが不要なサイトには静的ホスティングを使います。

  • ETagと条件付きリクエストは繰り返しトラフィックを減らします。
  • 大きなファイルにはバイト範囲リクエストが使えます。
  • 公開ルートではドットファイルを拒否したままにします。

静的サイト例

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

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

主なオプション

オプション使う場面
root公開ファイル向けに制限付きファイルシステムルートが必要な場合。
index_filesディレクトリをindexファイルへ解決したい場合。
deny_dotfiles隠しファイルが誤って公開されてはいけない場合。
directory_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.

日本語