Nginx-Primary script unknown的报错的解决方法
2024-08-26 04:48:34
配置nginx时一直报错:file not found
错误日志:
[error] 12691#0: *6 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.168.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.168.133"
改成下面的配置恢复正常,/datao/htdocs/thinkphp为根目录
{
listen 80;
server_name www.tp.com;
access_log /data1/logs/tp_access.log myformat;
index index.html index.htm index.php;
root /datao/htdocs/thinkphp; location ~ \.php
{
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME /data0/htdocs/thinkphp/$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}
最新文章
- 【leetcode】Remove Nth Node From End of List
- python学习之函数
- 简述Git(Linux、Android~~开源)
- CentOS 6.5升级Python和安装IPython(亲测可用)
- 中国Linux源镜像站大全
- jQuery.bind() 函数详解
- javascript判断回文数
- JavaScript中的3种弹出式消息提醒(警告窗口,确认窗口,信息输入窗口)的命令是什么?
- BZOJ1593 [Usaco2008 Feb]Hotel 旅馆
- SpringData JPA详解
- [转载]C# 多线程、控制线程数提高循环输出效率
- 清除Eclipse和Myeclipse中的工作空间目录
- JavaScript的OOP编程1
- Clouds
- 14.2.5.2 Clustered and Secondary Indexes
- 自动创建字符设备,不需mknod
- x64系统安装ODAC问题经验分享
- centOS 安装(光安装 和 u盘安装)
- [原创]基于SpringAOP开发的方法调用链分析框架
- .NET 开源项目 Anet 介绍
热门文章
- vsCode怎么为一个前端项目配置ts的运行环境
- grpc deadlines
- PHP的报错级别并返回当前级别error_reporting()
- springboot 实现自定义注解
- BZOJ1607 [Usaco2008 Dec]Patting Heads 轻拍牛头 【筛法】
- clique 解题报告
- 遇到问题---java---myeclipse中maven项目引用另一个导致的resource文件混乱的问题
- POJ2240:Arbitrage(最长路+正环)
- power designer 绘制E-R 图
- vue2学习篇一 $mount()手动挂载