静的サイト
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.