nginx 域名跳转配置

如下 www.game.com game.com 都 跳转到另外一个域名 pay.com

[root@web1 host]# cat www.game.com.conf
server {
listen 80;
server_name www.game.com game.com;
if ($host = 'www.game.com' ) {

rewrite ^(.*)$ https://pay.com/$1 permanent;
}

if ($host = 'yahgame.com') {

rewrite ^(.*)$ https://pay.com/$1 permanent;
}
}

Nginx 域名跳转配置