By the way, the nginx wiki says that you should avoid ifs when possible: http://wiki.nginx.org/IfIsEvil
Wouldn't something like this accomplish the same thing? (Sorry if I'm totally wrong, I'm not really good)
location /google/ {
}
location /y_key_/ {
}
location ~ \.html$ {
return 404;
}
location = /index {
return 404;
}
location / {
try_files $uri @rewrite
}
location @rewrite {
rewrite ^/$ /index.html break;
rewrite .* $uri.html break;
}