您的位置:首页 > 其它

域名跳转

2016-02-25 11:34 423 查看
listen 80; server_name www.test1.com www.aaa1.com www.bbb1.com; if ($host != 'www.test1.com'){ rewrite ^/(.*)$ http://www.test1.com/$1 permanent;}/usr/local/nginx/sbin/nginx -t/usr/local/nginx/sbin/nginx -s reload
测试 curl -x127.0.0.1:80 www.aaa1.com/sdsdsssss -IHTTP/1.1 301 Moved PermanentlyServer: nginx/1.8.0Date: Sat, 02 Jan 2016 06:52:38 GMTContent-Type: text/htmlContent-Length: 184Connection: keep-aliveLocation: http://www.test1.com/sdsdsssss 测试 curl -x127.0.0.1:80 www.test1.com/sdsdsssss -IHTTP/1.1 404 Not FoundServer: nginx/1.8.0Date: Sat, 02 Jan 2016 06:53:03 GMTContent-Type: text/htmlContent-Length: 168Connection: keep-alive
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  域名跳转