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删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM