Nginx配置——域名跳转

## 编辑配置文件linux

[root@aminglinux vhosts]# cd /usr/local/nginx/conf/vhosts/nginx

[root@aminglinux vhosts]# vim test.confvim

  server_name www.test.com www.aaa.com www.bbb.com;   ide

  if ( $host != 'www.test.com' ) {测试

       rewrite ^/(.*)$ http://www.test.com/$1 permanent;spa

}server

## 检查语法并从新加载it

[root@aminglinux vhosts]# /usr/local/nginx/sbin/nginx -tclass

[root@aminglinux vhosts]# /usr/local/nginx/sbin/nginx -s reloadtest

## 测试

WEBRESOURCE1ec11fd8c746ccd6bec6556efdc0a

参考:

WEBRESOURCE05cf44f72dbbdb53fc3e92fac8d19

相关文章
相关标签/搜索