Nginx-Primary script unknown的报错的解决方法


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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 Nginx报Primary script unknown的错误解决 CentOS 7 + Nginx 1.6.2 + PHP 5.4.45 FastCGI错误Primary script unknown网页显示File not found的解决办法 vue 报错unknown custom element解决方法 [转]vue启动项目报错:npm ERR! missing script: serve解决方法 navicat报错2005 - Unknown MySQL server host 'localhost' (0) 原因及解决方法 crontab -e 报错 E518: Unknown option: autochdir 解决方法 Nginx 报错 504 Gateway Time-out 的解决方法 nginx 启动报错 “/var/run/nginx/nginx.pid" failed” 解决方法 Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]报错解决方法 Vue直接引用