Nginx显示404而不是php页面

我安装了nginx,如果我去uberdrivingparttime.app/,我会得到通常的“欢迎来到nginx!” 屏幕。 我把index.php放在phpinfo()的文件夹中; 当我去uberdrivingparttime.app/index.php时,我得到了404! 这是来自config的我的服务器blcok。 希望有人知道发生了什么!</ p>

  server {
listen 80;
server_name www.uberdrivingparttime.com uberdrivingparttime.com;
access_log /srv/www/uberdrivingparttime.com /logs/access.log;
error_log /srv/www/uberdrivingparttime.com/logs/error.log;
nn location / {
root /srv/www/uberdrivingparttime.com/public_html;
index index .html index.htm index.php;
}

位置〜\ .php $ {
include / etc / nginx / fastcgi_params;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/ var /run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/uberdrivingparttime.com/public_html$fastcgi_script_name;
}
}
</ code> </ pre> \ n </ div>

展开原文

原文

I have nginx installed and if I go to uberdrivingparttime.app/ I get the usual "Welcome to nginx!" screen. I put an index.php in the folder with phpinfo(); and when I go to uberdrivingparttime.app/index.php, I get a 404! Here is my server blcok from config. Hopefully someone knows what's up!

server {
    listen   80;
    server_name www.uberdrivingparttime.com uberdrivingparttime.com;
    access_log /srv/www/uberdrivingparttime.com/logs/access.log;
    error_log /srv/www/uberdrivingparttime.com/logs/error.log;

    location / {
        root   /srv/www/uberdrivingparttime.com/public_html;
        index  index.html index.htm index.php;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        #fastcgi_pass 127.0.0.1:9000;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/uberdrivingparttime.com/public_html$fastcgi_script_name;
    }
}

1个回答



我是一个累了,愚蠢的白痴。</ p>

所以,除了 在/ etc / hosts我有.app的事实。 文件所在的目录是.com! 将服务器行切换到.app修复了所有内容。</ p>

哇。</ p>
</ div>

展开原文

原文

I am a tired, stupid, idiot.

So, everything is good here except for the fact that in /etc/hosts I have .app. The directory where the files are located are .com! Switching the server line to .app fixed everything.

Wow.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐