nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)

During the test of Nginx functionality today, the following problems occurred:
Nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg] bind() to 0.0.0.0:8083 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:7091 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:7092 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8081 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:1935 failed (98: Address already in use)

The reason is:
During the test, turn off the port number of RTMP,./kill -9 PID (RTMP :1935)
Results in starting the Nginx,./Nginx – c/usr/local/Nginx/conf/Nginx. Conf
The above error occurs

The result process is as follows:
First use lsof – I :80 to see what program is using port 80. Lsof returns the following:
[[email protected] sbin]# lsof – I :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 63170 root 9u IPv4 14243472 0t0 TCP *: HTTP (LISTEN)
Close process: Kill -9 63170
Restart the Nginx: [root @ localhost sbin] #./Nginx – c/usr/local/Nginx/conf/Nginx. Conf
Problem solving

Read More: