ngx_http_index_module

ngx_http_index_module 모듈은 슬래시 문자(‘/’)로 끝나는 요청을 처리합니다. 이러한 요청은 ngx_http_autoindex_module 및 ngx_http_random_index_module 모듈로도 처리할 수 있습니다.

예제 구성

location / {
    index index.$geo.html index.html;
}

Directives

Syntax:  index file ...;
Default: index index.html;
Context: http, server, location

인덱스로 사용할 파일을 정의합니다. file 이름은 변수를 포함할 수 있습니다. 파일은 지정된 순서로 검사합니다. 목록의 마지막 요소에는 절대 경로가 있는 파일을 사용할 수 있습니다. 예:

index index.$geo.html index.0.html /index.html;

참고로 인덱스 파일을 사용하면 내부 리디렉션이 발생하고, 요청이 다른 위치에서 처리될 수 있습니다. 예를 들어 다음과 같은 구성을 사용하면,

location = / {
    index index.html;
}

location / {
    ...
}

“/” 요청은 두 번째 위치에서 “/index.html”로 처리됩니다.