apache .htaccess to nginx rewrite rule
Nginx doesn't have htaccess files. The code needs to go into the nginx config file. Also, try adding the "last" flag to the rewrite:
# nginx configurationautoindex off;location / { rewrite .* /index.php last;}