Nginx rewrites converted from Apache do not work properly

I have nginx+php-fpm setup. I tried to convert .htacess rewrites from apache to nginx config, but it seems like it does not work.

Tried using all the possible public converters but the rewrites i have are kind of complicated. I tried using last instead of break or "last; break;" combination together

.htaccess:

<Files 'data_pages.db'>
Order Allow,Deny
Deny from all
</Files>
RewriteEngine on
RewriteRule ^$ index.php [L,QSA]
RewriteRule ^.+/$ index.php [L,QSA]
RewriteRule ^rss.php$ rss.php [L,QSA]
RewriteRule ^sitemap.php$ sitemap.php [L,QSA]
RewriteRule ^(.*php)$ index.php [L,QSA]

This is the code I use in nginx config:

location / {
  rewrite ^/$ /index.php break;
  rewrite ^/.+/$ /index.php break;
  rewrite ^/(.*php)$ /index.php break;
}

location = /rss.php {
  rewrite ^(.*)$ /rss.php break;
}

location = /sitemap.php {
  rewrite ^(.*)$ /sitemap.php break;
}

location /data_pages.db {
  deny all;
}

This is my /etc/nginx/sites-enabled/default

server {
        listen 80 default_server;
        listen [::]:80 default_server;
        listen 443 ssl default_server;
        listen [::]:433 ssl default_server;
        server_name ~^(www\.)?(?P<my_host>.+)$;
        root /home/sites/$my_host/;
     index index.html index.htm index.php;

         location ~* \.(css|js|txt)$
         {
         expires      1d;
              gzip on;
              gzip_min_length 1100;
              gzip_buffers 4 16k;
              gzip_types text/css text/javaascript application/x-javascript;

         }

      location ~* \.(gif|jpg|jpeg|png|ico|swf|bmp|)$
          {
           expires      5d;
           gzip off;
           }
       location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
                }

location / {
  rewrite ^/$ /index.php break;
  rewrite ^/.+/$ /index.php break;
  rewrite ^/(.*php)$ /index.php break;
}

location = /rss.php {
  rewrite ^(.*)$ /rss.php break;
}

location = /sitemap.php {
  rewrite ^(.*)$ /sitemap.php break;
}

location /data_pages.db {
  deny all;
}

}        

My Index.php:

<?php
$url = $_SERVER['QUERY_STRING'];
if(empty($url)) $url = $_SERVER['REDIRECT_QUERY_STRING'];
if(endsWith($url,'/')) $url .= 'index.php';
if($url == '/') $url = '/index.php';
$url = str_replace(str_replace('/index.php', '/', $_SERVER['PHP_SELF']), '/', $url);
$db = new SQLite3('data_pages.db');
$statement = $db->prepare('SELECT * FROM pages where url = :url');
$statement->bindValue(':url', $url);
$result = $statement->execute();
$row = $result->fetchArray();
if($row == false) { header('HTTP/1.0 404 Not Found'); die(); }
$content = str_replace('../', '', $row['content']);
echo eval('?>' . $content . '<?');
function endsWith($haystack,$needle) {
  return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
}
?>

The idea here is that my sites are generated in SQlite.. The Sqlite is installed and working, whenever i launch it on localhost apache it works. But when it's used on nginx with the code above it just shows a blank page and when I'm using "break" it also downloads my index.php, adding last; helps but still it shows a blank page instead of a site. Probably the syntax is wrong, since nginx is different but what exactly should I write in the config?