Назад | Перейти на главную страницу

nginx обслуживает файлы php

У меня проблемы с php тестовый файл на моем веб-сервере nginx.

По какой-то причине каждый раз, когда я пытаюсь достучаться до http: //localhost/test.php Я получаю известную ошибку No input file specified.

После открытия журналов ошибок я вижу такое сообщение:

[error] FastCGI sent in stderr: "Unable to open primary script: **/etc/nginx/html/**test.php (No such file or directory)" while reading response header from upstream, client: PUBLIC_IP, server: localhost, request: "GET /test.php HTTP/1.1"

По какой-то причине служба nginx считает, что мой корневой каталог /etc/nginx/html/, что явно не там, где я хочу.

Это мой default.conf:

server {
    listen       80;
    server_name  localhost;

#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
error_log /var/log/nginx/error.log;
location / {
    root   /usr/share/nginx/html;
    index   index.php index.html index.htm;
}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 404 /404.html;
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}
location /{

  try_files $uri $uri/ /index.php$args;
  }
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php${
  try_files $uri =404;
  fastcgi_pass unix:/var/run/php-fpm.sock
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
  }

}

Не могу найти, где это настроено. Что я делаю не так?