Custom index

Hello, I’ve tried to follow the suggestion wrote in GitHub as explained in topic:

But this doesn’t work at all…
Adding

location = / {
rewrite ^/$ /custom_index.html break;
}

doesn’t seems to have any effect neither replacing the preexisting 301 rule