Redirect pages from index.php to slash

if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}