0

I got my application with following configuration - CentOs + supervisord + wsgi + nginx + django. When i try to run ngix on 80 port, i got an error

nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
nginx.service: control process exited, code=exited status=1
Failed to start The nginx HTTP and reverse proxy server
Unit nginx.service entered failed state.
nginx.service failed.

It occures because 80 port is busy by defalut tcp

 netstat -tulpn | grep :80

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1979/httpd
tcp6       0      0 :::80                   :::*                    LISTEN      1979/httpd

When i kill everything on 80 port (fuser) and execute service supervisord start ngix starts and works fine on 80 port. I don't think changing nginx to work on different port is my solution since i need to listen 80 port to get access to my website. How to configurate ngix properly?

The nginx confing looks like this enter image description here

Alex Nikitin
  • 841
  • 1
  • 10
  • 29
  • 1
    the `netstat` output says that you have `httpd` service (aka apache) is running, you need to stop it first using `systemctl stop httpd && systemctl disable httpd` after that you can start nginx normally – Mostafa Hussein Jul 19 '21 at 05:09
  • Does this answer your question? [nginx - nginx: \[emerg\] bind() to \[::\]:80 failed (98: Address already in use)](https://stackoverflow.com/questions/14972792/nginx-nginx-emerg-bind-to-80-failed-98-address-already-in-use) – Don't Panic Jul 19 '21 at 08:31

0 Answers0