[nginx]nginx的一个奇葩问题 500 Internal Server Error phpstudy2018

[nginx]nginx的一个奇葩问题 500 Internal Server Error

解决方案

nginx 一直报500 Internal Server Error 错误,配置是通过phpstudy2018站点域名管理生成的。

默认是  root   "D:\php\phpstudy\PHPTutorial\WWW\foxphp";

修改成这样就好了

root   "D:\\php\\phpstudy\\PHPTutorial\\WWW\\foxphp";

查找了很多资料,因为很奇葩,木有多少可供参考的,之前配置单斜杠一直木有问题,也找不到为毛产生的。有人说是地址问题,或许是单斜杠被当成转义符号了吧,那就再加一个,然后就没有然后了,php网站可以通过域名正常访问了。

好吧,nginx我确实没有系统的从头到尾学习,一般能有就好。个人愚见,遇见了奇葩问题就记录了下来进行分享,或许能够给别人带来帮助。

server {
        listen       80;
        server_name  k.cn ;
        root   "D:\\php\\phpstudy\PHPTutorial\\WWW\\kppw";
        location / {
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}
server {
        listen       80;
        server_name  t.cn ;
        root   "D:\\php\\phpstudy\PHPTutorial\\WWW\\thinkphp\\public";
        location / {
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}
server {
        listen       80;
        server_name  o.cn ;
        root   "D:\\php\\phpstudy\PHPTutorial\\WWW\\opensns";
        location / {
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}
server {
        listen       80;
        server_name  f.cn ;
        root   "D:\\php\\phpstudy\\PHPTutorial\\WWW\\foxphp";
        location / {
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}
server {
        listen       80;
        server_name  abc.cn;
        root   "D:\\php\\phpstudy\\PHPTutorial\\WWW\\test";
        location / {
            index  index.html index.htm index.php;
            autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

原文地址:https://www.cnblogs.com/landv/p/11366547.html

时间: 2024-12-28 01:14:18

[nginx]nginx的一个奇葩问题 500 Internal Server Error phpstudy2018的相关文章

docker push 报错:received unexpected HTTP status: 500 Internal Server Error

解决办法:关闭selinux [[email protected] ~]# docker push 10.0.0.10:5000/nginx The push refers to a repository [10.0.0.10:5000/nginx] 22439467ad99: Retrying in 1 second b4a29beac87c: Retrying in 1 second 488dfecc21b1: Retrying in 1 second received unexpected

python urllib2导出elasticsearch数据时 返回 "urllib2.HTTPError: HTTP Error 500: Internal Server Error"

0.业务场景 将ES中某个index的某个字段的所有数据,导出到文件中 1.ES数据导出方法简述 ES数据导出方法,我主要找到了以下几个方面,欢迎大家补充: ES官方API:snapshot and restore module The snapshot and restore module allows to create snapshots of individual indices or an entire cluster into a remote repository like sha

EBS Webservice Timeout,HTTP Server Return "500 Internal Server Error"

http://blog.itpub.net/26687597/viewspace-1207571/ 基于Oracle EBS R12,开发了一个Webservice用于返回某项主数据,当请求的数据量非常大的时候(大于6000行的数据量),Oracle应用服务器总是给返回一个500 Internal Server Error.请求数据量小的时候,Webservice运行没有问题,能够正常返回请求数据. 客户端接到的报错: <!DOCTYPE HTML PUBLIC "-//IETF//DTD

解决方案:安装wordpress出现500 Internal Server Error

做一个资讯站点的时候遇到一个wordpress不知道算不算常见的问题:程序安装的时候提示500 Internal Server Error 那么最终百度谷歌找到以下解决方案: 安装新版本wordpress出现500 Internal Server Error的问题: 在./wp-includes/class-http.php的291行,改成 $request_order = apply_filters( 'http_api_transports', array( 'streams' ), $ar

HTTP Status 500 ? Internal Server Error

getWriter()和getOutputStream()不能同时调用 HTTP Status 500 ? Internal Server Error Type Exception Report Message getWriter() has already been called for this response Description The server encountered an unexpected condition that prevented it from fulfilli

在使用pydelicious时出现HTTP Error 500: Internal Server Error的错误的解决方法:

问题:在学习<集体智慧编程>的过程中,第二章中如果你遇到了pydelicious.PyDeliciousException: HTTP Error 500: Internal Server Error这样的错误具体的 解决方法我是在stack overflow上找到的,原文链接分为两个部分 http://stackoverflow.com/questions/29543799/pydelicious-get-popularprogramming- doesnt-return-any-valid

安装Destoon系统出现500 Internal Server Error错误的原因

当我们初次安装Destoon B2B网站管理系统出现"500 Internal Server Error"错误,其原因有一下几点: 解决办法一.删除根目录下.htaccess文件,如果无效,请尝试方法二: 解决办法二.对于Liunx/Unix服务器,如果不支持0777属性,可修改 根目录config.inc.php $CFG['file_mod'] = 0777; 为 $CFG['file_mod'] = 0755 ; 然后,FTP修改已经被系统自动修改为0777属性的目录和文件为07

使用Windows Live Writer发布CSDN博客出现500 Internal Server Error

今天按照<公告:CSDN博客频道支持Windows Live Writer离线写博客啦>学着使用Windows Live Writer写CSDN博客,结果碰到了评论中的500 Internal Server Error. 我在进行第三步"设置日志的远程发布网址,填写http://write.blog.csdn.net/xmlrpc/index "时(见上图)发生错误500 Internal Server Error.根据管理员先前的回复,这里出错的原因可能是用户名或密码错误

Tomcat 提示 HTTP Status 500 – Internal Server ErrorTomcat 提示 HTTP Status 500 – Internal Server Error

错误信息: 1 HTTP Status 500 – Internal Server Error 2 Type Exception Report 3 4 Message Error instantiating servlet class [Servlet.BeerSelect] 5 6 Description The server encountered an unexpected condition that prevented it from fulfilling the request. 7