zoukankan      html  css  js  c++  java
  • 简单配置nginx使之支持pathinfo

    1. 只需要修改3个地方就可以了,亲测成功,看代码有注解
    2. location ~ .php { #去掉$
      root E:/phpStudy/WWW/tp/public/;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_split_path_info ^(.+.php)(.*)$; #增加这一句
      fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;

    3. 下面是我完整的一个虚拟域名配置
    4. server {
      listen 80;
      server_name www.cs.com;
      root "E:/phpStudy/WWW/cs/public/";
      location / {
      index index.html index.htm index.php l.php;
      autoindex on;
      try_files $uri $uri/ /index.php?s=$uri&$args;
      }




      error_page 500 502 503 504 /50x.html;
      location = /50x.html {
      root html;
      }
      location ~ .php { #去掉$
      root E:/phpStudy/WWW/cs/public/;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_split_path_info ^(.+.php)(.*)$; #增加这一句
      fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;

      }

      }

     如果要看tinkphp5的nginx配置文件的话 这里有位大神给出了具体方式 传送门:http://www.thinkphp.cn/topic/40391.html

      

  • 相关阅读:
    vrf
    安装diskimage-builder制作ironic镜像
    打印bios启动日志
    iproute2更新
    ip link add type vrf报错哦
    ip link add type vrf报错哦
    case 条件语句
    Go项目结构
    MySQL与Python交互
    数据提取之JSON与JsonPATH
  • 原文地址:https://www.cnblogs.com/kzfbk/p/7302623.html
Copyright © 2011-2022 走看看