執行 Fluxheim
當你想快速啟動本地伺服器時使用此頁。它保持設定簡短,並在服務流量前進行檢查。
Install a release binary
curl -L https://github.com/valkyoth/fluxheim/releases/download/v1.8.0/fluxheim-1.8.0-full-x86_64-linux.tar.gz -o fluxheim.tar.gz
tar -xzf fluxheim.tar.gz
sudo install -m 0755 fluxheim /usr/local/bin/fluxheim
最小靜態站點
[server]
listen = ["0.0.0.0:8080"]
default_vhost = "site"
[[vhosts]]
name = "site"
hosts = ["example.com"]
[vhosts.web]
root = "/srv/example"
index_files = ["index.html"]
deny_dotfiles = true
第一個設定做什麼
| 選項 | 目的 |
|---|---|
server.listen | 控制 Fluxheim 開啟的 plain HTTP socket。 |
server.default_vhost | 當沒有 host 匹配時選擇 fallback site。 |
vhosts.hosts | 列出站點接受的 hostnames。 |
vhosts.web.root | 指向提供給訪客的目錄。 |
檢查並啟動
fluxheim --config /etc/fluxheim/fluxheim.toml --check-config
fluxheim --config /etc/fluxheim/fluxheim.toml
在部署指令碼中使用 config check。它會在切換流量前發現未知欄位、不安全路徑、無效 listener 和 feature/config 不匹配。
下一步有用選擇
- 只有在 DNS 指向 host 後再新增 TLS。
- Add cache only for routes that are safe to share between visitors.
- Add metrics only when the listener is private or behind a trusted proxy.