Base solution for your next web application
Open Closed

Access to XMLHttpRequest at 'https://...' from origin 'http://...' has been blocked by CORS policy #6976


User avatar
0
vnetonline created

amazingsolitions-client.azurewebsites.net/:1 Access to XMLHttpRequest at 'https://amazingsolutions.azurewebsites.net/AbpUserConfiguration/GetAll?d=1557379133284' from origin 'http://amazingsolitions-client.azurewebsites.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    If you have CORS configured correctly, check the backend logs.

    https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/appsettings.json#L15

  • User Avatar
    0
    vnetonline created

    yes i belive i have it right

    "App": { "ServerRootAddress": "https://amazingsolutions.azurewebsites.net", "ClientRootAddress": "https://amazingsolutions-client.azurewebsites.net", "CorsOrigins": "http://*.amazingsolutions.com.au,https://amazingsolutions-client.azurewebsites.net,https://amazingsolutions.azurewebsites.net" }

    This config is in my appsettings.Production.json

    I have built and deployed the Host project to Azure using the Release configuration.

  • User Avatar
    0
    maliming created
    Support Team

    Seems to be a typo.

    amazingsolitions-client.azurewebsites.net amazingsolutions-client.azurewebsites.net

  • User Avatar
    0
    vnetonline created

    good pick up maliming thanks you are a ledgend

    All good works, here is the result

    I will be making a video turorial on this process which will be avalible at www.amazingsolutions.com.au shall come back and update this post when it is ready.