配置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;
}
}

最新文章

  1. 【leetcode】Remove Nth Node From End of List
  2. python学习之函数
  3. 简述Git(Linux、Android~~开源)
  4. CentOS 6.5升级Python和安装IPython(亲测可用)
  5. 中国Linux源镜像站大全
  6. jQuery.bind() 函数详解
  7. javascript判断回文数
  8. JavaScript中的3种弹出式消息提醒(警告窗口,确认窗口,信息输入窗口)的命令是什么?
  9. BZOJ1593 [Usaco2008 Feb]Hotel 旅馆
  10. SpringData JPA详解
  11. [转载]C# 多线程、控制线程数提高循环输出效率
  12. 清除Eclipse和Myeclipse中的工作空间目录
  13. JavaScript的OOP编程1
  14. Clouds
  15. 14.2.5.2 Clustered and Secondary Indexes
  16. 自动创建字符设备,不需mknod
  17. x64系统安装ODAC问题经验分享
  18. centOS 安装(光安装 和 u盘安装)
  19. [原创]基于SpringAOP开发的方法调用链分析框架
  20. .NET 开源项目 Anet 介绍

热门文章

  1. vsCode怎么为一个前端项目配置ts的运行环境
  2. grpc deadlines
  3. PHP的报错级别并返回当前级别error_reporting()
  4. springboot 实现自定义注解
  5. BZOJ1607 [Usaco2008 Dec]Patting Heads 轻拍牛头 【筛法】
  6. clique 解题报告
  7. 遇到问题---java---myeclipse中maven项目引用另一个导致的resource文件混乱的问题
  8. POJ2240:Arbitrage(最长路+正环)
  9. power designer 绘制E-R 图
  10. vue2学习篇一 $mount()手动挂载