dongzhan5943 2015-11-13 03:54
浏览 48

使用Nginx配置Phabricator时出错

I'm installing Phabricator on CentOS7 using Nginx. I followed the nginx config from their site. When I try to access the url:portpha.mysite.com in browser, I got File not found message on browser and found error message in nginx log file :

Error Message in 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/"

I also checked if php-fpm is listening on port 9000 :

$ netstat -nap | grep 9000
tcp  0  0 127.0.0.1:9000  0.0.0.0:*   LISTEN      7884/php-fpm: maste

Here is my 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;
    }
}

Here is my php-fpm www.conf snippet :

listen = 127.0.0.1:9000
user = nginx
group = nginx

I've also set 777 for phabricator's webroot :

[root@centos phabricator]# ls -l
... ...
drwxrwxrwx  3 nginx nginx  4096 Nov 12 16:33 webroot

Is there any idea for troubleshooting this problem? Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写