nginx中文文档-ngx_http_random_index_module

ngx_http_random_index_module模块处理以“/”结尾的请求,并随机选取目录中的一个文件作为索引文件进行展示。该模块会在ngx_http_index_module模块之前处理。

该模块默认不会构建,需要通过–with-http_random_index_module参数启用。

示例配置

location / {
    random_index on;
}

random_index

语法:random_index on | off
默认:random_index off
上下文:location

启用或禁用location块中的random_index处理功能。