If this error is reported when starting nginx, you generally need to go to the log directory of the nginx installation to view the error log file error.log. We can further troubleshoot the errors that occur in nginx.
cat /nginx/logs/error.log
Found an error:
> bind() to 0.0.0.0:8000 failed (98: Address already in use)still could not bind()
1. Find the process occupying the port
lsof -i:8000
2. Use the kill command to kill the process.
kill -9 pid
3. Restart Nginx
systemctl restart nginx