美文网首页
nginx模块之random_index

nginx模块之random_index

作者: 谜00016 | 来源:发表于2018-11-20 16:24 被阅读7次

    官网地址
    这个模块的功能比较简单就是随机选择一个文件作为主页。默认是关闭的。
    我们来演示一下。
    首先修改配置文件,注意是在location节点下,


    ,很显然我在/opt/app/code1下准备了三个html文件。准备工作做好之后,还是老三样儿,检查-关闭nginx-启动nginx
    nginx -t -c /etc/nginx/nginx.conf
    nginx -s stop -c /etc/nginx/nginx.conf
    nginx -c /etc/nginx/nginx.conf
    

    在浏览器中访问192.168.205.103,多刷新几次,可以看到nginx随机选了不同的文件作为主页。

    相关文章

      网友评论

          本文标题:nginx模块之random_index

          本文链接:https://www.haomeiwen.com/subject/gtsxqqtx.html