Web 服务器 (IIS) 无法通过 HTTPS 加载静态文件(css、js、图像)

The web server (IIS) fails to load static files (css, js, images) over HTTPS

我正在通过托管服务提供商托管我的网站。当请求为 HTTP(即 http://example.com), but the web server (IIS) fails to load static files (css, js, images) over HTTPS (i.e. https://example.com)时,网站完美加载,我得到“加载资源失败:服务器响应状态为 403".

我检查了这个 link CSS, Images, JS not loading in IIS 它说我可能需要将匿名用户的身份设置为应用程序池身份。问题是我要求我的托管服务提供商执行该任务,但提供商告诉我他们不会对应用程序池身份执行此操作,因为这会增加模拟身份验证的安全漏洞。

我正在使用 .NET 5.0,我试图修改 launchSettings.json 文件以允许匿名身份验证,但这没有用,你知道还有什么可以我如何解决这个问题?

根据评论总结:

The problem was caused by hosting firewall. Migrated the website to another hosting provider, then the problem is gone.