Home > Net >  WebApi to deploy on ali cloud iis, cross-domain failure
WebApi to deploy on ali cloud iis, cross-domain failure

Time:10-28

WebApi to deploy on ali cloud iis, cross-domain failure, but the deployment of cross-domain is no problem on their own computers, what reason be excuse me? One day didn't solve

CodePudding user response:

CodePudding user response:

Services. AddCors (options=& gt;
{
Options. AddPolicy (" AllowSpecificOrigin, "
Builder=& gt;
{
Builder. WithOrigins (" http://0.0.0.0:3201 "). AllowAnyHeader ();
});
});


Assumes that the service port is 3201
Have this in the code?

CodePudding user response:

refer to the second floor superlinmeng response:
services. AddCors (options=& gt;
{
Options. AddPolicy (" AllowSpecificOrigin, "
Builder=& gt;
{
Builder. WithOrigins (" http://0.0.0.0:3201 "). AllowAnyHeader ();
});
});


Assumes that the service port is 3201
Have this in the code?


I open the cross-domain, deployment to the native iis cross domain can be
//cross-domain support
Services. AddCors ();


//cross domain middleware
App. UseCors (builder=& gt; Builder
AllowAnyOrigin ()
AllowAnyHeader ()
AllowAnyMethod ());

CodePudding user response:

refer to the second floor superlinmeng response:
services. AddCors (options=& gt;
{
Options. AddPolicy (" AllowSpecificOrigin, "
Builder=& gt;
{
Builder. WithOrigins (" http://0.0.0.0:3201 "). AllowAnyHeader ();
});
});


Assumes that the service port is 3201
Have this in the code?


The problem is likely to be ali cloud?
  • Related