VPS侦探论坛

 找回密码
 注册
查看: 3093|回复: 1

军哥帮我看看301跳转这么写有木有问题啊?

[复制链接]
发表于 2017-3-8 12:58:59 | 显示全部楼层 |阅读模式

写的301跳转从http跳转到https的写法
  1. server{
  2.                 listen 80;
  3.             server_name abc.com;
  4.             return 301 https://www.abc.com$request_uri;   
  5.          }
  6.          server{
  7.                 listen 80;
  8.             server_name www.abc.com;
  9.             return 301 https://www.abc.com$request_uri;   
  10.          }
复制代码



第二种写法:

  1. server{
  2.                 listen 80;
  3.             server_name abc.com;
  4.                         server_name www.abc.com;
  5.             return 301 https://www.abc.com$request_uri;   
  6.          }
复制代码




那种效率最高哇? 测试都正常.

还是第三种写法:
  1. server{
  2.                 listen 80;
  3.             server_name abc.com  www.abc.com;
  4.             return 301 https://www.abc.com$request_uri;   
  5.          }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-3-8 19:21:05 | 显示全部楼层


应该是没差别
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-27 17:24 , Processed in 0.025950 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表