I'm new with AWS... I have set up one EC2 instance where it runs Nginx and PHP 7.1.6 i have also made a page that return phpinfo(); details but it returning not my elastic IP but internal IP address:


My EC2 has correctly associated one elastic IP and also trying browsing website everything running smooth.

There is a way to let Nginx returns public IP instead of private one?


The EIP is not binded to any network interfaces.

The easiest way to get the EIP is through the instance's metedata.

$eip = file_get_contents('');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.