繁体   English   中英

Angular 生产构建文件超过 https

[英]Angular production build files over https

when I use ng serve in angular cli to serve my angular app everything is OK, my files: polyfill.js, styles.js, favicon.ico are served over http. However, when I do ng build --prod and serve that files over some http server, polyfill.js, styles.js, favicon.ico are requested over https, and since this is local server without https, loading fails. 我正在使用 Angular:11.0.4。 两年前我有类似的项目,我认为 angular 9,我使用的是相同的 http 服务器,只是在不同的机器上,它按预期工作(没有 https)。 这里有什么问题?

在此处输入图像描述

是 Content-Security-Policy header 迫使 https ...当我尝试简单的 http-server 形式 npm 时意识到这一点...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM