if ($request_uri ~ ^(.*)/index.(html|php)) { return 301 $1/$is_args$args; } location / { try_files $uri $uri/ /bitrix/urlrewrite.php$is_args$args; } location ~ \.php$ { fastcgi_index index.php; }