我正在使用Nginx在CentOS7上安装Phabricator。我从他们的网站上关注了nginx配置。当我尝试在浏览器中访问url:port pha.mysite.com
时,我在浏览器上收到File not found
消息,并在nginx日志文件中找到错误消息:
Nginx中的错误消息:
[error] 6433#0: *499 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 223.xxx.xxx.xxx, server: pha.mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "pha.mysite.com"
[crit] 6433#0: *499 stat() "/root/pha/phabricator/webroot/favicon.ico" failed (13: Permission denied), client: 223.xxx.xxx.xxx, server: pha.mysite.com, request: "GET /favicon.ico HTTP/1.1", host: "pha.mysite.com", referrer: "http://pha.mysite.com/"
我还检查了php-fpm
是否正在侦听端口9000
:
$ netstat -nap | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 7884/php-fpm: maste
这是我的nginx conf :
server {
listen 80;
server_name pha.mysite.com;
root /root/pha/phabricator/webroot;
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}
location = /favicon.ico {
try_files $uri =204;
}
location /index.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
#variables to make the $_SERVER populate in PHP
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 GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
}
}
这是我的php-fpm www.conf片段:
listen = 127.0.0.1:9000
user = nginx
group = nginx
我还为phabricator的webroot设置了777
:
[root@centos phabricator]# ls -l
... ...
drwxrwxrwx 3 nginx nginx 4096 Nov 12 16:33 webroot
有什么想法解决这个问题吗?感谢。