Base solution for your next web application
Open Closed

IIS / Access to XMLHttpRequest at from origin 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. #11186


User avatar
0
olmy90 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 10.2
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)?

If issue related with ABP Framework

  • What is ABP Framework version?

If issue is about UI

I've a problem on one server of customer - hosted on IIS: I've Angular FE and WEB API backend running on IIS as separate websites, same URL, different ports http://myURL.de:84, the Backend under port http://myURL.de:85

My setting is: "CorsOrigins": "http://*.myURL.de

I get this error - any idea whats wrong? Access to XMLHttpRequest at 'http://myURL.de:84/AbpUserConfiguration/GetAll?d=1658404623121' from origin 'http://myURL.de:85' 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. :84/AbpUserConfiguration/GetAll?d=1658404623121:1 Failed to load resource: net::ERR_FAILED


2 Answer(s)
  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi olmy90,

    It is only considered to be the same if the protocol, host and port is the same: [Same Origin Policy]

    You can update your settings to

    "CorsOrigins": "http://*.myURL.de, http://myURL.de:85"

  • User Avatar
    0
    palco.ps created

    Hi, can you help me , because i have the same prob. and i change my settings as your answer ,

    the errors still same :/