![](/img/trans.png)
[英]How to install ssl certificate without IIS in windows server 2016?
[英]CORS not working in a IIS Server without SSL Certificate
I have a .net core API application but CORS doesnt work if its deployed in a IIS server that don't have an SSL Certification
除了在我們的服務器中注冊 SSL 證書之外,還有其他解決方案嗎?
注意:我們已經在后面的代碼中指定允許所有來源/方法/憑據/標頭
這與我的問題相同。
我已經在我的 Startup.cs 中添加了這些,但它不起作用。
app.UseCors(builder => builder.WithOrigins("http://localhost:4200")
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials());
和
app.UseCors(builder => builder.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials());
我什至添加了一個 OptionsMiddleware 但似乎不起作用。
我有同樣的問題,但它解決了這個: -
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.