1、打开配置文件:/usr/local/nginx-1.8.0/conf/nginx.conf

这里 root就是代码指向的目录

       server_name就是域名

       location/  表示匹配所有url都执行匹配后操作,这里下面做了一个rewrite:

         if (!-e $request_filename){

            rewrite ^/(.*)$ /index.php/$1 last;

     }

       这个rewrite就是表示匹配到符合这里正则的url就自动添加上index.php,起到了帮我们的url自动补上index.php的作用,缩短了我们的url访问长度

Nginx和php安装及配置第三篇:nginx的配置文件

相关文章:

  • 2021-08-11
  • 2021-07-14
  • 2021-12-06
  • 2022-02-08
  • 2021-07-03
猜你喜欢
  • 2022-02-04
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案