需求:
个人云盘,存在大量敏感文件,需要进行严格权限校验,需要保留文件分享功能
文件分享功能uri如下:
/#s/7rm7maxA
/static/style/dist/main.css?v=1.25.1124
/static/app/dist/main.js?v=1.25.1124
/?user/view/manifestJS
/?explorer/share/fileOut&path=%7BshareItemLink%3A7rm7maxA%7D%2F&et=352da&name=/JavaWeb%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E4%B9%8BSQL%E6%B3%A8%E5%85%A5.pdf
/static/
/index.php?user/view/manifest
/plugins/pdfjs/
需要为以上路由添加白名单,不需要访问认证,其他需要访问认证,请问改怎么实现
老臣在使用if路由匹配时出现问题,
我一般是使用多个location段进行匹配,可以使用=表示精准匹配,通用匹配放最后:
例如:
location =/static/style/dist/main.css?v=1.25.1124 {
proxy_pass xxx; #使用=完整匹配不需要验证路径
}
location /{
auth_basic xxx;#使用默认通用匹配,匹配其他路径,需要访问认证
}
https://blog.csdn.net/carefree2005/article/details/110952184
我跟楼上的仁兄思路一样,就是详细匹配在前面,模糊的在后面!
我跟楼上的仁兄思路一样