运行 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.