I have a static site in the docker ngnix container. The site has a structure of the form http://site.ru/ , http://site.ru/about/ Each folder has its own index.html. That is, all pages can open at two addresses, for example, http: // site .ru / about / and http://site.ru/about/index.html are full duplicates. I want to make for all index.html 301th redirect. How to do it?

    1 answer 1

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

    Here is the solution.