默认配置当你访问http://abc.example.com/dir 时不会加”/”

常见做法

if (-d $request_filename){
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
}

更佳的替代方法

optimize_server_names off;#优化服务器名称:关
server_name_in_redirect off;#服务器名称重定向:关

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2022-02-08
相关资源
相似解决方案