Nginx 自动补全url地址补全最后的斜线

参考地址: http://blog.csdn.net/dong123dddd/article/details/51660368

    location /riskcontrol {
      root /data;
      # 解决访问riskcontrol不加斜线时无法访问问题
      if ( -d $request_filename ){
          rewrite ^/(.*)([^/])$ https://$host/$1$2/ permanent;
      }

      try_files $uri $uri/ /riskcontrol/index.html;
      access_log /app/logs/riskcontrol.log;
    }

    location /buyloan {
      root /data;

      # 解决访问buyloan不加斜线时无法访问问题
      if ( -d $request_filename ){
          rewrite ^/(.*)([^/])$ https://$host/$1$2/ permanent;
      }

      try_files $uri $uri/ /buyloan/index.html;
      access_log /app/logs/buyloan.log;
    }
原文地址:https://www.cnblogs.com/Csir/p/8473662.html