I\'ve seen a few ways to rewrite the $request_uri and add the index.html to it when that particular file exists in the file system, like so:
$request_uri
index.html
The following config allowed me to redirect /index.html to / and /subdir/index.html to /subdir/:
/index.html
/
/subdir/index.html
/subdir/
# Strip "index.html" (for canonicalization) if ( $request_uri ~ "/index.html" ) { rewrite ^(.*)/ $1/ permanent; }