0
votes

I have setup application load balancer in AWS. I have setup target and listeners correctly. Load balancer is configured to handle Https request and SSL certificate is also configured correctly from ACM.

All request over http and https from POSTMAN and Web browser are returning response correctly. It gives response correctly.

However when i am trying to make https request from Angular 6 app, it fails with following error:

net::ERR_CONNECTION_CLOSED

All HTTP requests are successful.

Many posts said to set Access-Control-Allow-Origin headers and its correctly set in my server api code.

Is there anything am I missing?

1

1 Answers

0
votes

You'll have to configure your CORS configuration in your AWS service, look at; https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html

Since Angular is a client-application, you'll always have to deal with this.

I would recommend you to read more into how this will secure you from hackers etc. But if you only test and want to hit your AWS you can allow all headers for the given HTTP request.

   <AllowedMethod>PUT</AllowedMethod>
   <AllowedMethod>POST</AllowedMethod>
   <AllowedMethod>DELETE</AllowedMethod>
   <AllowedHeader>*</AllowedHeader>

Read more about genereally CORS; https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS