[英]CORS ISSUES on Accessing Web Application on a Browser Outside Azure Virtual Machine
Good day all, I have an Angular and Asp.net Core Application deployed on IIS in Azure Virtual Machine.大家好,我有一个 Angular 和 Asp.net 核心应用程序部署在 IIS 虚拟机 Z3A580F142203677F1F3BC308 上。 It is working perfectly work on the IIS Localhost on the AZURE Virtual Machine but when trying to access the Application outside Virtual Machine using the IP address and the Port number, am having CORS Issue from origin 'http://10.95.102.55:95' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.
It is working perfectly work on the IIS Localhost on the AZURE Virtual Machine but when trying to access the Application outside Virtual Machine using the IP address and the Port number, am having CORS Issue from origin 'http://10.95.102.55:95'已被 CORS 策略阻止:对预检请求的响应未通过访问控制检查:响应中的“Access-Control-Allow-Credentials”header 的值为“”,当请求的凭据模式时必须为“真”是“包括”。 The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
XMLHttpRequest 发起的请求的凭证模式由 withCredentials 属性控制。
Please what could be the Problem because it is working on the Virtual Machine but outside the Virtual Machine is the problem, Have disable Window Firewall and Set both Inbound and Out-Bound rules on the Port.请问可能是什么问题,因为它在虚拟机上工作但在虚拟机外部是问题,禁用 Window 防火墙并在端口上设置入站和出站规则。 Please help is needed
请帮忙
Apply the below changes in your deployed application in iis.在 iis 中部署的应用程序中应用以下更改。
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET,POST,OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Content-Type, soapaction" />
</customHeaders>
</httpProtocol>
</system.webServer>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.