首页 > 其他 > 详细

Nginx try_files 典型配置

时间:2017-03-10 19:17:58      阅读:198      评论:0      收藏:0      [点我收藏+]

参考配置

server {

    listen 80;

    server_name 10.10.76.231;

    root html;

    index index.html index.php;


#1/2.html不可用则跳转指定文件3.html

    location /web {

        try_files /1.html /2.html /3.html;     

      }


#1/2.html不可用则跳转指定页面:www.baidu.com

    location /home {

        try_files /1.html /2.html @static;

      }


       location @static  {

              rewrite ^/(.*)$   http://www.baidu.com;    

       }

}




Nginx try_files 典型配置

原文:http://cangzihu.blog.51cto.com/6671848/1905260

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!