server { listen 80; server_name www.yourdomain.com; location /redirect-url { return 301 http://otherdomain.com; } }
server { listen 80; server_name www.yourdomain.com; return 301 http://yourdomain.com$request_uri; }