Redirect from one domain to another domain

rewrite ^/(.*)$ http://www.newdomain.com/$1 permanent;