如下 www.game.com game.com 都 跳转到另外一个域名 pay.com
[[email protected] host]# cat www.game.com.conf

1
2
3
4
5
6
7
8
9
10
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 域名跳转配置