Normally any website that responds to /index.php also responds to /. This has the potential to duplicate content. So how can you re-direct /index.php to / without causing infinite loop in nginx?

Here is a simple solution:

if ($request_uri ~* "^/index.php\??$") {
    rewrite ^.*$ http://$host? permanent;
}

It redirects any url with /index.php or /index.php? at the end. However it doesn't prevent internal re-direction to index.php as is normal with most PHP based web software.