首页 > Web开发 > 详细

centOS7.4 thinkPHP nginx 支持pathinfo和rewrite

时间:2018-06-09 23:53:48      阅读:308      评论:0      收藏:0      [点我收藏+]
server
{
    listen 80;
    server_name  www.demo.com  mayifanx.com;
    root  /data/www/demo;
    index index.php index.html index.htm;

    #红色部分支持rewrite
    location / {
          if (!-e $request_filename){
              rewrite ^(.*)$ /index.php?s=$1 last;
          }
    }

    location ~ \.php {
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;

          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

          #蓝色部分是支持pathinfo
          fastcgi_split_path_info ^(.+\.php)(.*)$;
          fastcgi_param PATH_INFO $fastcgi_path_info;

          include        fastcgi_params;

    }
}

 

centOS7.4 thinkPHP nginx 支持pathinfo和rewrite

原文:https://www.cnblogs.com/yuzhould/p/9161633.html

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