I am trying to set up an AWS Web Application. I have gotten everything pretty much working except that my backend. Whenever I launch the application I make API calls to my backend to get a list of products and such; however, I keep getting this "net::ERR_Connection_Refused."snip of console error when loading page
I have looked at the nginx logs and I don't believe the issue is there. I thought that it might be an issue with pm2 hosting the express server, but I have gotten it to work for a short period of time. After I changed from http to https it stopped working, but I'm not even sure if that is the issue. I thought it might also be a CORS issue, but I tested that with test.cors.org and it said it was fine. Any help would be much appreciated! nginx file
I make api calls to my backend to get a list of products and such
Your frontend runs in a web browser and is trying to call a backend on localhost. If the backend is on AWS, this will not work, as localhost is not routable over the internet.
You have to setup your instance to use regular domain, e.g. myapp.com
and setup proper SSL certification for it to use https
.