参考地址:
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; }