redirect
server {
server_name .mydomain.example;
rewrite ^ http://www.adifferentdomain.example$request_uri? permanent;
}
or on any version 0.9.1 or higher:
server {
server_name .mydomain.example;
return 301 http://www.adifferentdomain.example$request_uri;
}
HTTP redirect:
301 (permanent)
302 (temporary)