Nginx配置从域名A跳转到域名B

需求:已经有一个域名​https://a.cn​,然后想让访问a域名的直接访问​https://b.cn​

​**这里需要在A服务器的Nginx配置。**​

配置

location /xxx {
root /usr/local/nginx/html;
rewrite ^(.*) https://b.cn$1 permanent;
}