My website was working fine with Apache .htaccess rules. Now I have sifted it to nginx. I need help to convert following apache rules to nginx directives/configurations
Apache .htaccess rules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /public
RewriteRule ^(/)?$ index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
and my current nginx config file:
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm;
server_name myhost.com;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
}