gpt4 book ai didi

azure - 在 Azure Blob 存储上设置 STS header

转载 作者:行者123 更新时间:2023-12-02 07:29:10 26 4
gpt4 key购买 nike

我有一个静态站点,托管在 azure cdn 后面。我想设置 Strict-Transport-Security header ,但如果我尝试:

$blobProperties = @{
"x-ms-meta-Strict-Transport-Security" = "max-age=31536000; includeSubDomains; preload";
};

Set-AzureStorageBlobContent -Properties $blobProperties (other flag omitted for clarity)

这会引发错误

x-ms-meta-Strict-Transport-Security',值为'max-age=31536000;包括子域;预加载无效

可以设置标题吗?

最佳答案

I have a static site which is hosted behind an azure cdn. I'd like to set the Strict-Transport-Security header. Is it possible to set the header?

据我所知,不。无法设置此 header 。 Blob 存储允许您在属性中设置某些 HTTP header (例如 Cache-Control、Content-Type 等),但此特定 header 不是其中之一。

我阅读了一些有关此 header 的信息,据我了解,此 header 强制使用 HTTPS 协议(protocol)。默认情况下,可以通过 HTTPHTTPS 协议(protocol)提供 Blob 内容。

如果您希望仅强制执行 HTTPS 协议(protocol),我建议您在 Blob 上使用共享访问签名,并在那里使用协议(protocol)限制。请参阅此链接以获取有关此内容的更多信息:https://learn.microsoft.com/en-us/azure/storage/storage-dotnet-shared-access-signature-part-1#shared-access-signature-parameters .

关于azure - 在 Azure Blob 存储上设置 STS header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42206235/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com