I have a problem with nginx. I tried different solutions, but for me nothing work. That is my error:
4 root@BANANAS ~ # sudo service nginx restart :( Restarting nginx: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use) nginx: [emerg] bind() to [::]:443 failed (98: Address already in use) nginx: [emerg] bind() to [::]:443 failed (98: Address already in use) nginx: [emerg] bind() to [::]:443 failed (98: Address already in use) nginx: [emerg] bind() to [::]:443 failed (98: Address already in use) nginx: [emerg] still could not bind() nginx.
Can you help me?
Through a simple command you can verify the status of the Nginx configuration file: $ sudo systemctl config nginx The output will show if the configuration file is correct or, if it is not, it will show the file and the line where the problem is.
Probably other process is using specified port:
sudo netstat -tulpn
Get the PID of the process that already using 443. And send signal with kill command.
sudo kill -2 <PID> sudo service nginx restart
Aternatively you can do:
sudo fuser -k 443/tcp
Make sure you dont use old syntax:
server { listen :80; listen [::]:80; }
The above syntax will cause
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Correct syntax:
server { listen 80; listen [::]:80 ipv6only=on; }
or
server { listen [::]:80; }
Both above syntax will achieve the same thing, listening on both ipv4 and ipv6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With