Unable to send POST request to Express Application listening in EC2 instance

0

My Express application which is listening on port 4000 is not receiving any request based on what I see in the application logs. However, I can send the POST request through postman on my development machine no issue

I tried configurations such as opening up 4000 for all ip address or even all port for all ip address. I would always get the problem below

"Failed to connect to [website] port 4000: Connection refused"

I am using a form application which have limited capabilities to allow me to debug from the form side. The error message is the best I can get.

The only way I could get the POST request successfully sent is by using ngrok on EC2 itself which I know would bypass many configurations. I used the HTTP link provided by ngrok, which means SSL is not an issue I think?

Hence, I suspect the problem is on AWS side, but I am unfamiliar with AWS and is there a service I can use to identify the problem?

Adwin
질문됨 2년 전443회 조회
1개 답변
0

Can you tell us more about your setup? Is your EC2 instance behind an Application Load Balancer? Does your EC2 instance have a public IP address assigned? Is your EC2 instance in a public subnet? If not, do you have a NAT Gateway setup? Does your VPC have an Internet Gateway attached?

Here is a tutorial for setting up a web server on an EC2 instance. In your case, just replace the PHP setup with your Node JS setup. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateWebServer.html

AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠