Help apache to nginx rules

Hello guys hope that you guys help me to convert this apache rules to nginx

DirectoryIndex index.php

RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.)//(.)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?king-rewrite=$0&%{QUERY_STRING} [L]

Options -Indexes


You can use this website: for converting the above config to Nginx.

Here is the copy pasta for the above,

index index.php;

location / {
  rewrite ^(.)//(.)$ /%1/%2 redirect;
  if (!-e $request_filename){
    rewrite ^(.*)$ /index.php?king-rewrite=$0&$query_string break;