I had previously hosted my domain in a different instance in a different aws account but for some reason I had to delete that aws account and create a new one. I am now trying to host my domain in the new instance. So I went to my registrar`s account and deleted all the nameservers from the domain name and added the new nameserver. Then I added my domain into the hosted zone in aws. 
After waiting for 2 3 hrs my domain is still now working but if I visit the public IP it works.
I have edited the /etc/hosts file and added domainname.com there and also I have edited the /sites-available/default and added
server { # passenger_ruby /usr/bin/passenger_free_ruby; rails_env development; # add this if you get error like “Incomplete response received from application” from nginx / passenger listen 80 default_server; server_name fuitter.com, *.fuitter.com; root /usr/share/nginx/html/maggie/public/; # You must explicitly set 'passenger_enabled on', otherwise # Passenger won't serve this app. passenger_enabled on; } I have restarted my nginx server but still it is not working. security group then, in inbound rule I have set HTTP to anywhere and SSh to custom ip and in outbound i have set all traffic to anywhere. Is there anything wrong with this?