Hmmm that's getting strange: In my other server block, I had: server_name _; And I got this infinite loop. So I have now hardcoded the server name as: server_name www.mysite.com; Now I don't get the infinite loop, but the rewriting of mysite.com -> www.mysite.com doesn't happen.