ไซต์แบบ static
ให้บริการ HTML, CSS, รูปภาพ และไฟล์ดาวน์โหลดจากดิสก์โดยตรง นี่คือโหมดที่ง่ายที่สุดของ Fluxheim
ควรใช้เมื่อใด
ใช้ static hosting สำหรับเอกสาร product pages ดาวน์โหลด และไซต์ที่ไม่ต้องรัน application code ทุก request
- ETag และ conditional request ช่วยลดทราฟฟิกซ้ำ
- ช่วงไบต์ใช้ได้กับไฟล์ขนาดใหญ่
- ควรปฏิเสธ dotfiles ภายใต้ public roots ต่อไป
ตัวอย่าง static site
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
ตัวเลือกหลัก
| ตัวเลือก | ใช้เมื่อ |
|---|---|
root | ต้องการ filesystem root ที่จำกัดขอบเขตสำหรับไฟล์สาธารณะ |
index_files | ไดเรกทอรีควรแก้ไขเป็นไฟล์ดัชนี |
deny_dotfiles | Hidden files must never become สาธารณะ by accident. |
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.