开发者社区> 问答> 正文

301跳转错误,何故?

域名:www.aaa.com
论坛:bbs.aaa.com
正常应该是输入aaa.com就直接打开www.aaa.com,但现在是输入aaa.com打开的却是bbs.aaa.com,何故?是解析的问题还是nginx配置文件的问题?nginx配置文件如下:
server_name www.aaa.com www.bbb.com;
  if ($host = "47.94.xx.xx") { rewrite ^(.*)/$ https://www.aaa.com/$1 permanent; }
  access_log /data/wwwlogs/www.aaa.com_nginx.log combined;
  index index.html index.htm index.php;
  root /data/wwwroot/www.aaa.com/public;
  if ($ssl_protocol = "") { return 301 https://$host$request_uri; }

  include /usr/local/nginx/conf/rewrite/laravel.conf;
  #error_page 404 /404.html;
  #error_page 502 /502.html;
server_name bbs.aaa.com bbs.bbb.com;
  if ($host = "47.94.xx.xx") { rewrite ^(.*)/$ https://www.aaa.com/$1 permanent; }
  access_log /data/wwwlogs/bbs.aaa.com_nginx.log combined;
  index index.html index.htm index.php;
  root /data/wwwroot/bbs.aaa.com;
  if ($ssl_protocol = "") { return 301 https://$host$request_uri; }

  include /usr/local/nginx/conf/rewrite/discuz.conf;
  #error_page 404 /404.html;
  #error_page 502 /502.html;



展开
收起
司马清源 2017-10-18 23:46:16 2142 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载