Thanks for replying, even though I do not know what BIND is and how to configure it and even how it works.
What I did is the following:
So you need to tell your linux to allow processes to bind to the non-local address. Just add the following line into /etc/sysctl.conf file:
# allow processes to bind to the non-local address
# (necessary for apache/nginx in Amazon EC2)
net.ipv4.ip_nonlocal_bind = 1
and then reload your sysctl.conf by:
$ sysctl -p /etc/sysctl.conf
which will be fine on reboots.
It is from
this site.
After I did that, I can restart the server and nginx will automatically start.