I'm getting this error after running sudo nginx
command
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
nginx: [emerg] still could not bind()
Here is my security settings on AWS EC2:
In my Django project, I've created an config file for nginx: (nginx.conf)
(I'm also using uwsgi
as the second web server that is working fine)
# the upstream components nginx needs to connect to
upstream dcohort {
server unix:///tmp/dcohort.sock;
}
server {
listen 80;
listen [::]:80;
server_name *.amazonaws.com;
access_log off;
error_log /home/ubuntu/dcohort/logs/nginx_error.log;
location / {
include /etc/nginx/uwsgi_params;
uwsgi_pass dcohort;
}
}
then imported the configuration to /etc/nginx/nginx.conf
http {
include /home/ubuntu/dcohort/config/nginx.conf;
# ...
}