Ok fixed, everyone that want to fix this problem in nginx:
location ~ .php$ {
try_files $uri @missing;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
#The following parameter can be also included in fastcgi_params file
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location @missing{
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
#The following parameter can be also included in fastcgi_params>
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}