I'm trying to switch from Apache to nginx, but I'm having trouble with .htaccess, this is the .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/index.php/$2 [L,QSA]
</IfModule>
and this is the rewrite I configured in ngnix
location ~ \.php$ {
if (!-e $request_filename) {
rewrite ^(.*)$ /web/index.php/$2 break;
}
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
but when I load the site is returned me this error
2017/02/20 09:17:24 [error] 12058#0: *1 "/html/MYSITE/web/index.php/index.php" is not found (20: Not a directory), client: MYIP, server: MYSITE, request: "GET /phpinfo/ HTTP/1.1", host: "MYHOST"
can anyone help?