I'm inexperienced in Linux systems and now trying to configure Nginx + Nodejs server. First of all trying to make it work and configure fast-cgi php for phpMyAdmin. When I use the default "/usr/share/nginx/html" directory. Everything is working fine, but when I change the root directory to "/home/ftpuser/web/public", I got "no input file specified" error in the browser. Hovewer my test page is a simple html...
My nginx config file is the following:
server {
listen 80 default_server;
server_name _;
#root /home/ftpuser/web/public;
root /usr/share/nginx/html;
index index.html index.htm index.php;
location / {
try_files maintenance.html $uri $uri/index.html $uri/index.php;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location @node {
error_page 405 = @backend;
add_header X-Cache "HIT from Backend";
proxy_pass http://212.24.106.170:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
#proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
I have no clue what is wrong. I just guessing maybe it is something permission issue? Does anyone has an idea what is the problem?
UPDATE:
Based on nginx error.log, it is a pretty permission issue:
[crit] 32338#0: *1 stat() "/home/ftpuser/badgirlz/public//index.html" failed (13: Permission denied), client: 78.92.44.152, server: _, request: "GET / HTTP/1.1", host: "domain.com"
I have made the following:
chown -R nginx:nginx /home/ftpuser/web/public
chmod -R 755 /home/ftpuser/web/public
However it is still not solved the issue...