使用随机主页需要使用到的模块 http_random_index_module
nginx设置随机主页_nginx
添加配置代码,vi /etc/nginx/conf.d/default.conf

location / {
        root   /usr/share/nginx/html;
        #index  index.html index.htm;
        random_index on;
    }

需要在/usr/share/nginx/html目录下面建多个html文件
nginx设置随机主页_其他_02