To perform domain verification for google, I must serve a file at the root of my domain. The filename is typically googleXXXXXXXXXXXXX.html
(those Xs are a hex substring).
So I copied it to my site's root (/var/www/html/
), and edited nginx's config like this:
location ~* /google.+\.html$ {
alias /var/www/html/$1;
}
Though I get a 404. I didn't hardcode the filename, but it fails even if I do.
Please note I know of this widely-used trick:
location = /googleXXXXX.html {
rewrite ^/(.*) $1;
return 200 "google-site-verification: $uri";
}
But I don't want to do that because it's not future proof - I want to serve the file as is.