2

i have simple nodejs app running on ec2 instance, when tried to access the app from browser using "ec2-18-223-0-201.us-east-2.compute.amazonaws.com:4545 refused to connect." it give me

This site can’t provide a secure connection

when trying to curl it from VM using curl http://localhost:4545 it works correctly, however when trying curl http://127.0.0.1:4545 it give me this output

Found. Redirecting to https://127.0.0.1:4545/

here's my security rules for the instance, i'm allowing all ip's to access the instance

enter image description here

also checking if the app is running at port 4545

sudo netstat -tulpn | grep :4545
tcp6       0      0 :::4545                 :::*                    LISTEN      1942/node  

I've been stuck into this issue from yesterday without any luck, neither know what's the cause, i've tried several solutions, non works :/

5
  • 1
    First guess is this has something to do with the application you’re running and not ec2. I think you should re-ask the question providing some details about the node app, including configuration or part of the app code. Aug 25, 2019 at 17:29
  • 1
    I tried to reach your app and could not. It just timed out. Are you sure it is allowed in the firewall? Aug 25, 2019 at 17:40
  • @MichaelHampton how can i achieve that?
    – M1M6
    Aug 25, 2019 at 17:51
  • @JeffSnider will update the question with my service.js file
    – M1M6
    Aug 25, 2019 at 17:51
  • Actually just figured it out, there was a middleware that redirecting all http to https, commented that line and it worked, my bad 🤗 , thanks guys ur comments helped me :D
    – M1M6
    Aug 25, 2019 at 17:58

1 Answer 1

0

Actually just figured it out, there was a middleware in the node app that redirecting all http to https, commented that line and it worked, my bad 🤗

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .