question

SamoSimoni-6501 avatar image
0 Votes"
SamoSimoni-6501 asked CristianSPIRIDON72 answered

Wordpress hosted on Azure Web service

I added google analysis to our web page which is designed in WordPress and published on Azure web service. When google tag is added the following error occurs:

Refused to load the script 'https://www.googletagmanager.com/gtag/js?id=UA-197342200-2' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline' .msecnd.net .google.com *.gstatic.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I was trying to find .htaccess file in wp-admin directory on Kudo but it does not exist. I would like to know where can I find file which is responsible for CSP for WordPress hosted on Azure.

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CristianSPIRIDON72 avatar image
0 Votes"
CristianSPIRIDON72 answered

Hi,

Below is a tutorial about how you can modify response headers for a Web App. You can manually add CSP header with the right value.

https://www.azuretechguy.com/modifying-response-headers-in-azure-app-service

Hope this helps!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.