Nginx配置從域名A跳轉到域名B
需求:已經有一個域名https://a.cn,然後想讓通路a域名的直接通路https://b.cn
配置
location /xxx {
root /usr/local/nginx/html;
rewrite ^(.*) https://b.cn$1 permanent;
}
需求:已經有一個域名https://a.cn,然後想讓通路a域名的直接通路https://b.cn
location /xxx {
root /usr/local/nginx/html;
rewrite ^(.*) https://b.cn$1 permanent;
}