Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to host for Public ip access in ASAP web host #6435


User avatar
0
kalidarscope created

Geeting error while accessing using Public ip

Access to XMLHttpRequest at 'http://localhost:22742/AbpUserConfiguration/GetAll?d=1549523850420' from origin 'http://104.209.192.181:4200' 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.


1 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi,

    you need to add your public ip address to the cors policy at https://github.com/aspnetzero/aspnet-zero-core/blob/e609cfa09116e7918975da28d8bcdaffe1d0c1c8/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/appsettings.json#L15

    See more at https://docs.microsoft.com/en-us/aspnet/core/security/cors