ngx_http_index_module 모듈
ngx_http_index_module 모듈은 슬래시 문자(' / ')로 끝나는 요청을 처리하는 모듈이에요. 이런 요청은 ngx_http_autoindex_module와 ngx_http_random_index_module 모듈로도 처리할 수 있어요.
출처: 문서
본문
예시 구성 (Example Configuration)
location / {
index index.$geo.html index.html;
}
지시어 (Directives)
| Syntax: | index file ...; |
|---|---|
| Default: | index index.html; |
| Context: | http, server, location |
인덱스로 사용할 파일들을 정의해요. 파일 이름에는 변수가 포함될 수 있어요. 파일들은 지정된 순서대로 확인돼요. 목록의 마지막 요소는 절대 경로를 가진 파일일 수 있어요. 예시:
index index.$geo.html index.0.html /index.html;
인덱스 파일을 사용하면 내부 리다이렉트가 발생하고, 요청이 다른 location에서 처리될 수 있다는 점을 기억해 두세요. 예를 들어 다음 구성에서:
location = / {
index index.html;
}
location / {
...
}
"/" 요청은 실제로 두 번째 location에서 "/index.html"로 처리돼요.