Converting Rewrites to Nginx

I have been trying to convert the following htaccess rules to nginx with
no
luck.

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I’ve tried:

location / {
if (!-e $request_filename){
rewrite ^(.+)$ /index.php?url=$1 last;
}
}

and I’ve also tried:

location / {
try_files $uri $uri/ /index.php?url=$1 last;
}

None seem to work. Any help with this is greatly appreciated.

Posted at Nginx Forum:

location / {
try_files $uri $uri/ /index.php?url=$1 last;
}

Maybe what you want here is:
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php/$1;
}

Thanks for pointing me in the right direction. That last part gave me a
redirect loop error, so I changed it to this:

rewrite ^/(.*)$ /index.php?url=$1;

I applied it, loaded the site, restarted nginx, and loaded the site
again.
It seems to work. Hopefully, my change is not just a fluke but will
continue
to work. However, if you think my change will cause an issue for the
future, please let me know. Again, thanks for your help.

Posted at Nginx Forum:

Ugh, I spoke too soon. It works when the urls are like this:
http://example.com/install?step=1

But it does not work when the urls are like this:

http://example.com/dashboard/
http://example.com/profile/

Sometime it brings back 404 Not Found and other times it comes back with
500
Internal Error

@Miguel, trying it my way and trying it the way you suggested, both give
me
a 404/500. Do you have any suggestions? Thanks.

Posted at Nginx Forum: