Skip to content

Instantly share code, notes, and snippets.

@ridwanray
Created February 24, 2024 14:06
Show Gist options
  • Select an option

  • Save ridwanray/7ed3a605336bd84bac341cc8310b8024 to your computer and use it in GitHub Desktop.

Select an option

Save ridwanray/7ed3a605336bd84bac341cc8310b8024 to your computer and use it in GitHub Desktop.
NGINX UNBIND ERROR FIX
sudo pkill -f nginx & wait $!
sudo systemctl start nginx
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-01-31 10:43:23 UTC; 3 weeks 3 days ago
Docs: man:nginx(8)
CPU: 54ms
Jan 31 10:43:22 ip-172-31-87-191 nginx[815104]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Unknown error)
Jan 31 10:43:22 ip-172-31-87-191 nginx[815104]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Jan 31 10:43:22 ip-172-31-87-191 nginx[815104]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Jan 31 10:43:22 ip-172-31-87-191 nginx[815104]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Unknown error)
Jan 31 10:43:22 ip-172-31-87-191 nginx[815104]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Jan 31 10:43:22 ip-172-31-87-191 nginx[815104]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Jan 31 10:43:23 ip-172-31-87-191 nginx[815104]: nginx: [emerg] still could not bind()
Jan 31 10:43:23 ip-172-31-87-191 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jan 31 10:43:23 ip-172-31-87-191 systemd[1]: nginx.service: Failed with result 'exit-code'.
Jan 31 10:43:23 ip-172-31-87-191 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
@ridwanray
Copy link
Copy Markdown
Author

I encounted this error when I stopped the nginx ( sudo systemctl stop nginx) in order to run cert-bot dry command (sudo certbot renew --dry-run )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment