server{ ... if ($host != 'bbs.koogay.com' ) { rewrite ^/(.*)$ http://bbs.koogay.com/$1 permanent; } ... }