Azure存储的Blob:在斑点级别设置CORS? [英] Azure Storage Blob: set CORS on the blobs level?

查看:185
本文介绍了Azure存储的Blob:在斑点级别设置CORS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我们已经建立了CORS与整个容器:

  Azure存储CORS设置--blob静态--cors'[{AllowedOrigins:*,AllowedMethods:GET,MaxAgeInSeconds:86400} ]'

是否有可能直接和单独设置的规则为每一滴在该容器中?

例如。 - 对静态/图像/ pic.png 设置AllowedOrigins:*静态/ CSS / style.css中 - 设置AllowedOrigins:google.com


解决方案

  

是否有可能直接和单独设置的规则为每
  该容器BLOB?


不幸的是没有。我理解 CORS 的方式是,它在某种程度上使2域之间的信任。随着Azure存储,域是由服务(如 youraccount.blob.core.windows.net 等)。因此CORS规则被设定在服务级别

Currently, we have set CORS for the whole container with:

azure storage cors set --blob static --cors '[{"AllowedOrigins":"*","AllowedMethods":"GET","MaxAgeInSeconds":"86400"}]'

Is there any possibility to set rule directly and separately for each blob in that container?

E.g. - for static/images/pic.png set "AllowedOrigins":"*" but for static/css/style.css - set "AllowedOrigins":"google.com"?

解决方案

Is there any possibility to set rule directly and separately for each blob in that container?

Unfortunately no. The way I understand CORS is that it somehow enables trust between 2 domains. With Azure Storage, the domains are by service (e.g. youraccount.blob.core.windows.net etc.). Thus the CORS rules are set at the service level.

这篇关于Azure存储的Blob:在斑点级别设置CORS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆