Redirect pages from .html to pages without .html

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