donglan6777 2016-05-04 13:56
浏览 873

Nginx显示404而不是php页面

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条回答 默认 最新

  • dounaidu0204 2016-05-04 14:00
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题