$document_uri  表示访问的url 
现在我的需求是,访问 www.abc.com  请求到 www.abc.com/abc/
在nginx配置文件中加入

if ($document_uri !~ 'abc')
{
rewrite ^/(.*)$ http://www.abc.com/abc/$1 permanent;
}

而不是单独加一句  rewrite ^/(.*)$ http://www.abc.com/abc/$1 permanent;
如果只加rewrite 规则,而不限定条件,那么会造成死循环。  会访问到   http://www.abc.com/abc/abc/abc/abc/....

相关文章:

  • 2021-12-27
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-01-24
  • 2021-12-27
  • 2021-12-27
猜你喜欢
  • 2021-12-09
  • 2021-11-18
  • 2022-02-19
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案