Static síður
Þjónaðu HTML, CSS, myndum og niðurhali beint af diski. Þetta er einfaldasti Fluxheim-hamurinn.
Hvenær á að nota þetta
Notaðu static hosting fyrir skjöl, vörusíður, niðurhal og síður sem þurfa ekki forritskóða í hverju requesti.
- ETag og conditional requests minnka endurtekna umferð.
- Byte ranges virka fyrir stærri skrár.
- Dotfiles eiga að vera áfram bannaðar í public rootum.
Dæmi um static síðu
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
Helstu valkostir
| Valkostur | Notaðu það þegar |
|---|---|
root | Þú vilt bounded filesystem root fyrir public files. |
index_files | Mappa á að leysast í index file. |
deny_dotfiles | Hidden files mega aldrei verða public fyrir slysni. |
directory_listing | Þú birtir viljandi repository-style file indexes. |
Dæmi um repository 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.