例如:
index.aa.com/index.html连接要跳转到index.bb.com/index.html,一级域名不变,
变的只有二级域名部分和路径部分,即:.aa前面的后.com后面的有变化
if ( $http_host ~* "^(.*?)\.aa\.com$" ){
set $domain $1;
rewrite ^/(.*) http://$domain.bb.com/$1 permanent;
}
例如:
index.aa.com/index.html连接要跳转到index.bb.com/index.html,一级域名不变,
变的只有二级域名部分和路径部分,即:.aa前面的后.com后面的有变化
if ( $http_host ~* "^(.*?)\.aa\.com$" ){
set $domain $1;
rewrite ^/(.*) http://$domain.bb.com/$1 permanent;
}
本文标题:Nginx域名跳转
本文链接:https://www.haomeiwen.com/subject/ghpjiftx.html
网友评论