404 не найденный при попытке получить доступ к index.php

Недавно я переустановил сервер с Ubuntu 14.04 LTS, nginx/1.6.1 и php5-fpm. Когда я пытаюсь получить доступ к index.html, это работает, когда я пытаюсь получить доступ к index.php, я становлюсь "404 Не Найденным". Я проверил .conf файлы дважды, и я не могу найти то, что является проблемой.

server {
    listen  m.y.i.p:80;
    server_name  www.example.com;
    rewrite ^(.*) http:// example.com$1 permanent;
}

server {
    listen  m.y.i.p:80;
    server_name example.com;

    root /var/www;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.html;
    }

    access_log off;
    error_log /var/www/error.log;
    rewrite_log on;
    error_page 403 404 /404.html;

    error_page 500 502 503 504 /404.html;
    location = /404.html {
        root /var/www;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        # With php5-fpm:
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
        expires 365d;
    }
}

Помогите.Спасибо!

1
задан 14 September 2014 в 19:26
1 ответ

Как оказалось, это "502 Bad Gateway", а не "404 Not Found", я нашел здесь ответ на свою проблему. https://stackoverflow.com/a/16497957/1845728 .

1
ответ дан 4 December 2019 в 00:19

Теги

Похожие вопросы