按照Azure 存盤中的靜態網站托管和將自定義域添加到端點中的說明,我設法通過 Azure CDN 獲得了一個帶有自定義域和 https(盡管帶有“www”子域)的靜態網站。
但是,blob 端點以“/$web/index.html”結尾,這也是訪問自定義域所必需的。所以它的形式是:
https://www.<customdomain>.com/$web/index.html
由于我使用的 SPA 框架,它立即變為:
https://www.<customdomain>.com/$web/index.html#/home
這有點長。
我看到了在根自定義域上處理 https 的說明,如果我感到勇敢,可以嘗試一下。但是有沒有辦法抑制該/$web/index.html部分?目前,如果我去:
https://www.<customdomain>.com
我得到:
<Error>
<Code>InvalidQueryParameterValue</Code>
<Message>Value for one of the query parameters specified in the request URI is invalid. RequestId:...</Message>
<QueryParameterName>comp</QueryParameterName>
<QueryParameterValue/>
<Reason/>
</Error>
uj5u.com熱心網友回復:
不要將您的自定義域映射到常規 blob 端點(例如https://mystorageaccount.blob.core.windows.net/),請嘗試將其映射到靜態網站端點,它看起來像https://mystorageaccount.z22.web.core.windows.net.
一旦你這樣做了,那么你就不需要$web在你的請求中指定,因為這個端點總是從$webblob 容器中獲取內容。
你可以Static website在 Azure 門戶中的存盤帳戶部分找到存盤帳戶的靜態網站終結點。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/329474.html
