域名跳转
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
测试 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
相关文章推荐
- 域名从www跳转到非www,Apache和Nginx2种解决方式
- 域名跳转
- Apache+mod_jk+tomcat配置虚拟主机不同域名跳转
- 基于域名的虚拟主机做域名跳转
- Apache用户认证,域名跳转,Apache访问日志
- Apache用户认证、域名跳转、访问日志格式
- Apache(httpd)配置--用户认证,域名跳转和访问日志配置
- Apache用户认证、域名跳转、访问日志格式
- Apache用户认证、域名跳转、Apache访问日志
- nginx 分别对各个域名跳转
- LAMP构架-域名跳转
- 用户认证,域名跳转以及日志
- 域名跳转
- LAMP搭建8:设置301域名跳转
- Nginx域名跳转
- 域名跳转
- apache域名跳转
- 84.LAMP的apache用户认证,域名跳转,日志文件
- day 42 Apache认证及常见功能
- 如何实现域名A指向域名B?三种域名跳转方法供选择