nginx/error.log
2017/08/08 18:57:57 [error] 21460#0: *11 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,
Body 显示
File not found.
Http info
Request URL:http://dabaojian.com/test.php
Request Method:GET
Status Code:404 Not Found
Remote Address:10.108.213.187:30330
Referrer Policy:no-referrer-when-downgrade
Response Headers
Connection:close
Content-Encoding:gzip
Content-Type:text/html
Date:Tue, 08 Aug 2017 11:07:48 GMT
Server:Tengine/1.4.2
Transfer-Encoding:chunked
Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:zh-CN,zh;q=0.8,en;q=0.6
Cache-Control:max-age=0
Connection:keep-alive
Host:www.baidu.com
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
nginx.conf
worker_processes 4;
error_log /home/test/conf/logs/error.log;
pid /home/test/conf/logs/nginx.pid;
events {
use epoll;
worker_connections 4096;
}
http {
access_log off;
include mime.types;
sendfile on;
gzip on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 0;
client_body_timeout 10;
client_header_timeout 10;
client_header_buffer_size 1k;
large_client_header_buffers 4 4k;
output_buffers 1 32k;
client_max_body_size 64m;
client_body_buffer_size 256k;
fastcgi_intercept_errors on;
include vhost/*.conf;
}
vhost.conf
server
{
listen 30330;
server_name test.com;
root /home/test/webRoot/www;
index index.php;
location / {
rewrite ^/(.*)$ /index.php?$1 last;
}
location ~* \.(js|css|html|png|gif|jpeg|jpg|ico|xml|apk|eot|woff|pdf|swf|svg|jsx)$ {
try_files $uri /resource/html/$uri =404;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
fastcgi_index index.php;
}
}
Fastcgi
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REDIRECT_STATUS 200;
web服务目录为777权限
nginx: nginx/1.9.15
php-fpm: 5.5.25
2 回答
精慕HU
TA贡献1845条经验 获得超8个赞
排除以下问题
-
Nginx
未重启 -
Fpm
未重启 文件目录无权限
-
SCRIPT_FILENAME
未配置
已尝试更换了Nginx
版本,还是这样,实在看不到哪个细节出错了,尴尬了
- 2 回答
- 0 关注
- 654 浏览
添加回答
举报
0/150
提交
取消