zoukankan      html  css  js  c++  java
  • nginx不支持pathinfo模式解决方法

    错误描述:1,打开网页,页面提示不支持pathinfo
                     2,类似 index.php/hellworld 会提示找不到页面
    解决办法:1,修改nginx.conf的server{} 中的内容下:
                备注: 如果是在vhost配置下可单独添加在vhost配置文件下,如果没有vhost则在nginx.conf配置文件下添加
    75         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    76         #
    77         location ~ .php {
    78             root           html;
    79             fastcgi_pass   127.0.0.1:9000;
    80             fastcgi_index  index.php;
    81             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    82             include        fastcgi_params;
    83         #pathinfo support
    84             set $real_script_name $fastcgi_script_name;
    85             set $path_info "";
    86             if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$"){
    87                 set $real_script_name $1;
    88                 set $path_info $2;
    89             }
    90
    91             fastcgi_param SCRIPT_NAME $real_script_name;
    92             fastcgi_param PATH_INFO $path_info;
    93              
    94         }

  • 相关阅读:
    react的路由以及传值方法
    三连击
    给网页添加鼠标样式
    单词统计(续)
    个人课程总结
    构建之法阅读笔记02
    构建之法阅读笔记01
    第十六周总结
    计算最长英语单词链
    第十五周总结
  • 原文地址:https://www.cnblogs.com/stoneryan/p/4210468.html
Copyright © 2011-2022 走看看