Ошибка Got File not found после настройки блока сервера nginx

#nginx

#nginx

Вопрос:

Я пытаюсь настроить серверный блок nginx с той же конфигурацией, которую я использовал на другом сервере, который хорошо работал на другом сервере, но по какой-то причине я не смог выяснить, не может работать на новом сервере, пытаюсь его настроить. ниже, если файл конфигурации

  server {
    set $project_root /var/www/test.example.com/html;     

    charset utf-8;
    client_max_body_size 128M;

    listen 80;
    server_name test.example.com;
    root $project_root;
    index index.html index.htm index.php;

    location / {
        rewrite ^/(.*)$ /index.php?$argsamp;request_filename=$1 last;
        try_files $uri $uri/ @rewrite;
    }
   
    location @rewrite {
        rewrite ^/(.*)$ /index.php?$argsamp;request_filename=$1 break;
    }
    
    location /nginx_status {
      stub_status on;
      access_log off;
      allow 127.0.0.1;
      deny all;
    }
    location ~ [^/].php(/|$) {
      fastcgi_pass unix:/run/php-fpm/www.sock;
      fastcgi_index index.php;
      include fastcgi.conf;
    }
    
    location ~ .*.(uploads|img|images)?$ {
        expires 7d;
        access_log off;
    }

    location ~ .*.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico|svg|woff2|ttf)$ {
      expires 30d;
      access_log off;
    }
    location ~ .*.(js|css|plugins|assets)?$ {
      expires 7d;
      access_log off;
    }
    location ~ ^/(.user.ini|.ht|.git|.svn|.project|LICENSE|README.md) {
      deny all;
    }


    location ~ ^/(.user.ini|.ht|.git|.svn|.project|LICENSE|README.md) {
      deny all;
    }
  }
  

и ошибка из test.example.com.error

 errorlog
2020/10/02 14:07:20 [error] 6493#0: *1 FastCGI sent in stderr: "Primary script unknown" while readin
g response header from upstream, client: 214.64.240.229, server: test.example.com, request: "GET / H
TTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "test.dajubet.com"
2020/10/02 14:08:09 [error] 6493#0: *1 FastCGI sent in stderr: "Primary script unknown" while readin
g response header from upstream, client: 214.64.240.229, server: test.example.com, request: "GET / H
TTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "test.example.com"
  

любая помощь о том, как это исправить, будет оценена по достоинству

Комментарии:

1. /var/www/test.example.com/html/index.php Существует ли файл?

2. @ Richard Smith да, у меня есть index.php в каталоге

3. SCRIPT_FILENAME Задано в fastcgi.conf файле?

4. @Richard Smith да, он установлен, и если я получу доступ к своему серверу с IP, я смогу просматривать все файлы, включая php-файл в каталоге / usr / share / nginx / html, без ошибок, но эта ошибка возникает при настройке блока сервера и доступа с доменным именем