1

angular-webiを使用して作成したangular5アプリケーションをazure webappサービスにデプロイします。私が何をしたか:Angular5をAzure webappにデプロイする:コンテンツセキュリティポリシー

テストケースのため

CD distの

//汚い部分--aot新しいtestappと

NGビルド--prod ngを:

のgit initを

git add *

git commit -m 'initial commit'

gitがリモート紺碧https://[email protected]:443/xxx.git

Gitのプッシュアズールマスター

出力を追加:

Finished successfully. remote: Running post deployment command(s)... remote: Deployment successful. remote: App container will begin restart within 10 seconds.

をので、すべてがうまくようです。展開が完了した後、私はURLに向かう場合は、私は残念ながら受け取る:

をエラーで/

を取得することはできません:

コンテンツセキュリティポリシー:ページの設定は、「(自分でリソースの読み込みをブロックdefault-src http://xxx.azurewebsites.net ")。

私が今までに見たすべてのチュートリアルまたは例(1つ)その点でCSPや何かを気にしないでください。どんな助け? https://www.henrihietala.fi/how-to-secure-your-asp-net-azure-web-app/

答えて

1

は、あなたがあなたにCSPに関するいくつかの情報を提供します。このドキュメントを参照することが

<system.webServer> 
    <httpProtocol> 
    <customHeaders> 
     <add name="Content-Security-Policy" value=" 
     default-src 'self'; 
     style-src 'self' 'unsafe-inline'; 
     script-src 'self' https://*.vo.msecnd.net; 
     connect-src wss: https:;" /> 
    </customHeaders> 
    </httpProtocol> 
</system.webServer> 

、以下のようにCSPヘッダをチェックしてみてください。

また、このMSDNスレッドを参照することもできます:https://social.msdn.microsoft.com/Forums/vstudio/en-US/18425bf2-49d2-4ad6-824d-b84205ab0eea/adding-content-security-policy-xxss-protection-to-my-web-app?forum=windowsazurewebsitespreview、役立つ可能性があります。

+0

ご回答ありがとうございます。私はdistにweb.configを作成し、repoに追加してプッシュしました。何も起こっていない、同じ問題です。 ; スタイル-srcの <= "コンテンツのセキュリティ・ポリシー" の値=」 デフォルト-srcの '自己' の名前を追加します。ファイルの内容はこれです'self' 'unsafe-inline'; script-src 'self' https://*.azurewebsites.net; connect-src wss:https :; " /> Baerree

関連する問題