I found help in the nginx irc chat.
Basically what I needed to do was use a return instead of rewrite. So I changed this:
location = / {
rewrite "^$" /wiki/Main_Page;
}
to this:
location = / {
return 301 http://www.example.com/wiki/Main_Page;
}