정적 사이트
HTML, CSS, 이미지, 다운로드를 디스크에서 직접 제공합니다. 가장 단순한 Fluxheim 모드입니다.
언제 사용하는가
요청마다 application code가 필요 없는 문서, 제품 페이지, 다운로드, 사이트에는 static hosting을 사용하세요.
- ETag와 conditional request는 반복 traffic을 줄입니다.
- 대형 파일에는 byte range가 동작합니다.
- public root에서는 dotfile을 계속 거부해야 합니다.
static site 예제
[[vhosts]]
name = "docs"
hosts = ["docs.example.com"]
[vhosts.web]
root = "/srv/docs"
index_files = ["index.html"]
deny_dotfiles = true
주요 옵션
| 옵션 | 사용할 때 |
|---|---|
root | public file을 위한 bounded filesystem root가 필요합니다. |
index_files | directory가 index file로 resolve되어야 합니다. |
deny_dotfiles | hidden file은 실수로도 public이 되면 안 됩니다. |
directory_listing | repository 스타일 file index를 의도적으로 게시합니다. |
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.