location / {
random_index on;
}
random index指令 语法: random_index on | off; 默认值: random_index off; 配置段: location 启用或者禁用random index模块 转摘请注明出处:http://www.ttlsa.com/html/2956.html
前言 一般情况下,一个站点默认首页都是定义好的index.html、index.shtml、index.php等等,如果想站点下有很多页面想随机展示给用户浏览,那得程序上实现,显得尤为麻烦,如果你
安装了nginx,那么使用nginx的random index即可达成这个功能,凡是以/结尾的请求,都会随机展示当前目录下的文件作为首页.
random index介绍 ngx_http_random_index_module模块处理以'/'为后缀的请求,并且在当前目录下随机抽取一个页面作为首页.这个模块将在ngx_http_index_module模块之前执行. 默认情况下,这个模块没有安装,你需要在安装nginx的时候加上配置参数--with-http_random_index_module.
随机首页配置
转载于:https://my.oschina.net/766/blog/211483