Подозреваю, что дело где-то в конфиге NGINX, но где именно — не могу понять. Файл конфига стандартный, который создается при установке панели.
Как я понимаю, NGINX отрабатывает файлы с помощью инструкций PHP-FPM. Сокет с инструкциями PHP-FPM подключен строкой (адрес правельный, файл существует)
Код: Выделить всё
fastcgi_pass unix:/var/run/php-fpm/php72w-site.sock;При прямом запросе к PHP-файлу с содержимым
Код: Выделить всё
<?php
phpinfo();
?>Ниже выкладываю файл самого конфига NGINX /etc/nginx/sites-available/site.com.conf
Код: Выделить всё
server {
listen  91.210.169.176:80;
server_name  site.com www.site.com;
root  /home/site/workspace/sites/site.com;
#SEO START
# 301 http - https
return 301 https://$host$request_uri;
#301 www - no www
if ($http_host ~ "^www\.(.*)$")
{
    set $http_host_1 $1;
    rewrite ^(.*)$ https://$http_host_1/$1 redirect;
}
rewrite ^/download_song/([0-9]+)/(.*)/$ /download_song.php?id=$1&name=$2 last;
#SEO END
access_log /etc/nginx/vhost_logs/site.com_access;
error_log /etc/nginx/vhost_logs/site.com_error;
                        
location ~ /.well-known { allow all; }
# location ~* robots.txt  { root /etc/nginx; }
        location ~ /\.ht {
        deny all;
        access_log off;
        log_not_found off;
        }
location /
{
index index.php index.html index.htm;
rewrite ^(.*)$ https://$http_host$request_uri redirect;
	if (!-e $request_filename)
	{
		rewrite ^(.+)$ /index.php?q=$1 last;
	}
}
location ~ \.php$ {
	    try_files $fastcgi_script_name =404;
            root                       /home/site/workspace/sites/site.com;
            #fastcgi_pass       localhost:9009;
            fastcgi_pass unix:/var/run/php-fpm/php72w-site.sock;
            include fastcgi_params;
            fastcgi_split_path_info                 ^(.+?\.php)(/.*)?$;
            fastcgi_index index.php;
            fastcgi_param   SCRIPT_FILENAME         /home/site/workspace/sites/site.com$fastcgi_script_name;
            fastcgi_param   PATH_TRANSLATED         /home/site/workspace/sites/site.com$fastcgi_script_name;
            fastcgi_buffers 8 64k;
            fastcgi_buffer_size 128k;
            fastcgi_busy_buffers_size 128k;
            fastcgi_connect_timeout 120;
            fastcgi_read_timeout 900;
            fastcgi_send_timeout 900;
    	                fastcgi_cache off;
	                fastcgi_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
            fastcgi_cache_valid 200 10s;
            limit_conn lfcgi 50;
            #fastcgi_param   SCRIPT_FILENAME         /workspace/sites/site.com$fastcgi_script_name;
            #fastcgi_param   PATH_TRANSLATED         /workspace/sites/site.com$fastcgi_script_name;
            set             $path_info              $fastcgi_path_info;
            fastcgi_param   PATH_INFO               $path_info;
                        }
            		
		
		
        # error_page  404              /404.html;
        # location = /40x.html {
        # }
        # error_page   500 502 503 504  /50x.html;
        # location = /50x.html {
        # }
        }  
Теперь произошло что-то странное. Переустановил NGINX, теперь по всем урлам отдается не 404 как раньше, а содержимое главной.
Мои размышления приводят только к тому, что (не знаю как грамотно сказать), но по любому запросу отрабатывает только index.php, могу ошибаться. Уже не знаю что думать.