If you have configured IIS or Apache before configuring Ngnix, nginx may not be able to start. The following error message is displayed:
A new service called "Web Deployment Agent Service" (MsDepSvc) can also trigger "System" with PID = 4 to listen on port 80.
You can use the netstat-aon command to find out which process (through PID) is occupying port 80. The PID occupied by IIS here is 4 (System)
If Apache is in use, you only need to modify the VirtualHost in the configuration.
If it is IIS, it will be a little troublesome.
First, change the port of the Default Site from 80 to another port in inetmgr. Then stop the IIS Service (World Wide Web Publishing Service, that is, W3SVC ).
Then find the Service of the Web Deployment Agent Service (MsDepSvc) and stop it (IIS Remote proxy Service ).
In addition, if the SQL Server Reporting Services Service is also started, you need to disable the service.
Then Nginx should be able to start normally.