Created AWS web service and test to enter web site dns and error message occurs

I was creating AWS webservice for cloud web service project and this web service is shopping mall

I completed creating AWS Cloud infrastructure with my architecture

and I finished checking that architecture’s components can communicate with each other by pinging with each ec2 server with different subnets including public and private subnets

they all communicates with each other

then deploying web application on each backend ec2 and frontend ec2 server

then run server and enter the DNS

web pages were loaded

but the following error messages output

[Vuetify] [UPGRADE] ‘v-content’ is deprecated, use ‘v-main’ instead. console.ts:34
found in ***
—> VMain
*** VApp

*** App

*** Root***

***POST ‘http ec2-xxx-xxx-xxx-xxx.us-west-1 compute amazonaws com 8000/Product/item_list’ ***

xhr.js:177

net::ERR_CONNECTION_REFUSED

Uncaught (in promise) Error : Network Error createError.js:16

*** at t.exports (createError.js:16)***

*** at XMLHttpRequest.d.onerror (xhr.js:84) ***

***POST ‘http ec2-xxx-xxx-xxx-xxx us-west-1 compute amazonaws com 8000/Bag/bag_count’ ***

xhr.js:177

net::ERR_CONNECTION_REFUSED
Uncaught (in promise) Error: Network Error createError.js:16

*** at t.exports (createError.js:16)***
*** at XMLHttpRequest.d.onerror (xhr.js:84)******

the things that you need to know before you answer my question for reference

  • I setup overall based on my architecture

these followings are the general view of my architecture

  1. there is 1 public subnet contains “bastion host ec2”, “Application Load balancer(internetfacing)”, “NAT gateway”

  2. there are 3 private subnets

classified as 1 frontend deployed ec2 server / 1 backend deployed ec2 server / 1 AWS RDS DB - MYSQL MARIADBserver

for each 3 private subnets

  1. frontend used node.js / vue.js

backend used Django with RESTful API

for restful API using axios

Database using MySQL MariaDB

  1. the route table settings are completed and I checked the both private subnets and public subnets can communicate and ping with each other without error

and these are the configuration of AWS VPC route table “Routes” section

-public subnet and 0.0.0.0/0 internet gateway are assigned to route table for public subnet

-private subnets and 0.0.0.0/0 NAT gateway are assigned to route table for private subnet

  1. the interesting discovery is that

I tested so many times

and I found

private route table is allowed to be assigned whether private subnets are assigned or not

and then I tested both of cases

first test case 1. assigning frontend ec2 private subnet and Backend ec2 private subnet

to private route table which is assigned NAT gateway as Routes like above

second test case 2. remove assignment of frontend ec2 private subnet and backend ec2 private subnet from same private route table

then I entered the web site

and results are different

the first case is error occurred

the second case is well activated properly

and the first case here is the part that the error message highlighted with bold letter is occurred

my estimated diagnosis is the matter of private subnet route table

how can I solve this problem?

to summarize situation and the error message highlighted

I completed configuring AWS web service with AWS resource components

and turn on chrome developer tool

then I enter the web site address

[Vuetify] [UPGRADE] ‘v-content’ is deprecated, use ‘v-main’ instead. console.ts:34
found in ***
—> VMain
*** VApp

*** App

*** Root***
POST ‘http://ec2-xxx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com:8000/Product/item_list’ xhr.js:177
net::ERR_CONNECTION_REFUSED
Uncaught (in promise) Error: createError.js:16
Network Error ***
*** at t.exports (createError.js:16)

*** at XMLHttpRequest.d.onerror (xhr.js:84) ***
POST ‘http://ec2-xxx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com:8000/Bag/bag_count’ xhr.js:177
net::ERR_CONNECTION_REFUSED
Uncaught (in promise) Error: createError.js:16
Network Error
*** at t.exports (createError.js:16)***
*** at XMLHttpRequest.d.onerror (xhr.js:84)******

this has been occurred

but when I deassigned the private subnets from private route table

then the error is solved

but I need to put my private subnets into private network in VPC in accordance to my architecture

how can I make the frontend ec2 server and backend ec2 server with different private subnets communicating with each other

or I found something that this error may be caused by same origin policy with http ?

or just it is problem of wrong configuration?

how can I solve?

please advise me