[Solved] Windows Nginx Startup Error: bind() to failed (10013: An attempt was made to access a socket

Solution 1:

(1) Check the error.log in the nginx-1.19.2\logs directory, and learn that the error message is: bind() to failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

(2) Press win+r, type cmd, and open the administrator interface

(3) type netstat -aon|findstr :80, find the port number is occupied, check the pid value of 4

(4) Enter tasklist | findstr “4” to find the name corresponding to port 4, which is System

(5) after viewing the System system occupancy can not be manually terminated, the reason is SQLServer Reporting Services, stop this service and set to start manually can, after starting nginx, need to restart SQLServer Reporting Services

Disadvantage: This approach requires you to stop SQLServer Reporting Services again after each boot, and then start nginx

Solution 2:

Modify the default port number under nginx.conf

(1) Open the nginx.conf file in the nginx directory with Notepad

(2) Press win+r, type cmd, open the administrator interface, type netstat -aon|findstr :expected port number to see if your expected port number is occupied

(3) Modify nginx.conf, and then save it

(4) At the command prompt, type nginx -s reload (an important step)

(5) Then type start nginx at the command prompt

(6) in the browser localhost:81, if the following page appears in the modified successful

Read More: