ngx_http_autoindex_module 모듈
ngx_http_autoindex_module 모듈은 슬래시 문자(‘/’)로 끝나는 요청을 처리해서 디렉터리 목록(directory listing)을 만들어 내는 모듈이에요. 보통 ngx_http_index_module 모듈이 인덱스 파일을 찾지 못할 때 요청이 ngx_http_autoindex_module 모듈로 전달돼요.
출처: 문서
본문
예시 구성 (Example Configuration)
location / {
autoindex on;
}
지시어 (Directives)
| Syntax: | autoindex on | off; |
|---|---|---|
| Default: | ``` | |
| autoindex off; |
|
| Context: | http, server, location |
디렉터리 목록 출력을 활성화하거나 비활성화해요.
| Syntax: | autoindex_exact_size on | off; |
|---|---|---|
| Default: | ```
autoindex_exact_size on;
| | Context: | http, server, location |
HTML 형식에서, 디렉터리 목록에 정확한 파일 크기를 출력할지, 아니면 킬로바이트, 메가바이트, 기가바이트 단위로 반올림해서 출력할지를 지정해요.
| Syntax: | autoindex_format html | xml | json | jsonp; |
|---|---|---|---|---|
| Default: | ``` | |||
| autoindex_format html; |
|
| Context: | http, server, location |
이 지시어는 버전 1.7.9부터 사용할 수 있어요.
디렉터리 목록의 형식을 설정해요.
JSONP 형식을 사용할 때는 콜백 함수의 이름이 callback 요청 인자로 설정돼요. 인자가 없거나 빈 값이면 JSON 형식이 사용돼요.
XML 출력은 `ngx_http_xslt_module` 모듈로 변환할 수 있어요.
| Syntax: | autoindex_localtime on | off; |
|---|---|---|
| Default: | ```
autoindex_localtime off;
| | Context: | http, server, location |
HTML 형식에서, 디렉터리 목록의 시간을 현지 시간대(local time zone)로 출력할지 UTC로 출력할지를 지정해요.