Trang static
Phục vụ HTML, CSS, hình ảnh và tệp tải xuống trực tiếp từ đĩa. Đây là chế độ đơn giản nhất của Fluxheim.
Khi nào dùng
Dùng static hosting cho tài liệu, product pages, downloads và các site không cần application code ở mỗi request.
- ETag và conditional request giúp giảm lưu lượng lặp lại.
- Phạm vi byte hoạt động cho các tệp lớn hơn.
- Dotfiles nên tiếp tục bị chặn trong public roots.
ví dụ static site
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
tùy chọn chính
| Tùy chọn | Dùng khi |
|---|---|
root | Cần một filesystem root có giới hạn cho các file công khai. |
index_files | Một thư mục sẽ phân giải thành một tệp chỉ mục. |
deny_dotfiles | Hidden files must never become công khai by accident. |
directory_listing | Bạn cố tình xuất bản các chỉ mục tệp kiểu kho lưu trữ. |
Ví dụ về danh sách kho lưu trữ
[[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.