3

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: enter image description here

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;
        # ...
}
ali60vip
  • 370
  • 1
  • 5
  • 13
  • ugh, seeing the same issue. also nginx+Django. I had the setup working fine, but after stopping the old ec2 machine and creating the new one , nginx won't restart, and letsencrypt certbot fails the certificate dance for this reason. most likely the config went bad... – alexakarpov Nov 05 '22 at 02:31
  • Getting the same error here, guys any of you found the solution? – Nabil Aug 13 '23 at 21:13

0 Answers0