> For the complete documentation index, see [llms.txt](https://yangsx95.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yangsx95.gitbook.io/notes/distributed/web-fu-wu-qi/nginx/sui-ji-fang-wen-ye-mian.md).

# 随机访问页面

## http\_random\_index\_moudle

目录中选择一个随机主页，比如想要随机生成主页，此时就需要此模块，不太常用。

```nginx
Syntax: random_index on | off;
Default: random_index off;
Context: location

location / {
    root html/index; # 在此路径中放入多个文件，打开 random_index 每次将会随机访问一个文件
    # index index.html index.htm;
    random_index on;
}
```
