total noob: why is my geolocation API IP lookup failing with 'private IP' on AWS EC2?

Author
Malik Mensah Author
|
23 hours ago Asked
|
3 Views
|
0 Replies
0

hey everyone, hope it's okay to ask a super noob question here. i saw the 'Geolocation API failing on lookup?' thread and it got me thinking about my own problem.

i just moved my little side project, a simple web app, from my local machine to an AWS EC2 instance. everything else seems to be working, but the part where i use a third-party geolocation API to get location data based on the user's IP address is totally breaking now. it was fine when running locally.

the API calls are returning an an error that mentions "private IP" or "internal IP" and i'm really lost. i don't even know where to begin debugging this or why moving to AWS would suddenly cause this. is there some kind of network configuration i'm missing or an AWS specific thing i need to know about for external IP address lookup?

hereโ€™s a snippet of the error i'm seeing:

{
  "code": 400,
  "message": "Bad Request: Cannot perform IP lookup on private IP address '172.31.X.X'",
  "details": "The provided IP address belongs to a private network range and cannot be geolocated externally."
}

any pointers would be super helpful, i'm completely new to this cloud stuff. help a brother out please...

0 Answers

No answers yet.

Be the first to provide a helpful answer!

Your Answer

You must Log In to post an answer and earn reputation.