0
votes

We are trying to serve a angular project from cloud storage via cloud CDN using a load balancer. We have configured a load balancer and a cloud storage bucket backend which is pointing to static content having the build artifact of an angular project. We are able to access the angular project, by hitting the load balancer http:///index.html, which in turn redirects to angular project dashboard with route path "/dashboard".

Now, when I refresh, the output comes with an error as shown below

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code> NoSuchKey </Code>
<Message> The specified key does not exist. </Message>
</Error>

It seems it is looking for file name /dashboard file which is not our project.

Is there any way we can set the default root to "index.html" which will fix it ?

2

2 Answers

0
votes

you have to set angular into a proxy. the cleanest load balancer is nginx for angular or kemp. I could pillage someone else's work and claim it as my own like others or I just googled one of many articles - I am not affiliated nor do I know these people. its very simple but you may have to change resource urls from the client/server side rendering if you are calling any api's to the proxy address.

https://www.techiediaries.com/angular-10-proxy-configuration-angular-json/

https://www.journaldev.com/27234/nginx-reverse-proxy-node-angular

0
votes

https://cloud.google.com/storage/docs/gsutil/commands/web You could use this to set the default main page and error page for your cloud storage bucket in case the error page file does not exist in the bucket, which is leading to XML ERROR.