-1

i installed nginx server in ubuntu instance. then i copy my data into /var/www/html folder. then i access site through public ip. its working fine. Then i create A record with public ip address. so i can access with domain name. After few hours i am not accessing the site. I checked in server nginx service is running. but i can't access the website. ports are open in security group for that instances. curl localhost curl privateip curl publicdns are working. but curl with public ip is not working. could you please help me this issue.

1 Answers1

1

You'll probably want to create an Elastic IP, associate with the instance, and associate your DNS record with that. IP addresses for instances are released when the instance is stopped, unless you have an elastic ip associated, which will then persist across stops/starts.

  • yes i agreed your answer. but i am not stopping instance till now same ip is there.Last day its working fine that ip. my question is why suddenly its not working. Just now I tried to restart the instance so IP is changed. when i try to access the new IP it is working few minutes. after that page is not displayed. – user3664609 Mar 30 '19 at 03:39
  • Ah, ok. I'd start by checking your logs on the server, checking if you can you curl locally - that kind of thing. Unfortunately, I'm not sure there's enough information here to effectively be of assistance. – semipermeable Mar 30 '19 at 17:53