我打算将有角项目部署到亚马逊s3。
我有这个项目的领域。
我们称之为mydomain.co
。
我为此s3存储桶的Cloudfront安装了ssl。
让我们致电Cloudfront网址为https://examplecloudfront.net
我将mydomain.co
的CNAME www设置为https://examplecloudfront.net
。
在这里,我必须使用什么基本URL来构建角度?
我使用了ng build --prod --base-href https://examplecloudfront.net/
但它仅适用于前行网址,不适用于https://www.mydomain.co
它显示这样的错误。
main.xxx.bundle.js:1 ERROR Error: Uncaught (in promise): SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'https://examplecloudfront.net/#/' cannot be created in a document with origin 'https://www.mydomain.co' and URL 'https://www.mydomain.co'.
Error: Failed to execute 'replaceState' on 'History': A history state object with URL 'https://examplecloudfront.net/#/' cannot be created in a document with origin 'https://www.pitchexdata.com.au' and URL 'https://www.mydomain.co'.
如何解决此错误? 谢谢