Curl: (7) Failed to connect to 10.0.130.62 port 80 after 0 ms: Connection refused

curl: (7) Failed to connect to 10.0.130.62 port 80 after 0 ms: Connection refused

Have already configured VPC allocated Elastic IP created subnets private and Public
public pointing Internet Gateway private pointing NAT
Im trying to curl from an instance public to an Instance in Private Subnet
Im getting the below error
curl: (7) Failed to connect to 10.0.130.62 port 80 after 0 ms: Connection refused

Hi @farhan1124, you have the error message in your screenshot:

Yout "Private.pem" isn’t accessible in this host and folder.

Thanks,
KodeKloud Support

can you help me fix it

You need to check where is your key and fix your path.

Thanks,
KodeKloud Support

But How how shall i fix please guide

Hi, @farhan1124 I don’t have access to your host to guide you. This requires that you know where you saved your key and have access to it. It isn’t a problem with Kubernetes or any other tool. This is about your environment. You need to:

  • Identify where is your key
  • If it is not in this server, copy it there
  • Give the right permissions
  • Access remote host through ssh

Thanks,
KodeKloud Support

and for the same instance if I curl im getting this error

what im doing is im trying to connect to a private subnet instance from a public subnet instance

Looks like those are ec2 instances. Have you opened your security groups?

Thanks,
KodeKloud Support