a blog for those who code

Monday 14 September 2015

How to solve bind() to 0.0.0.0:80 failed error in nginx

In this post we are going to show how to solve the error "bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)". If you are installing nginx in windows you might encounter an error like "An attempt was made to access a socket in a way forbidden by its access permissions" which will prevent the nginx to start.

Lets say you have donwloaded the latest version of Nginx and tried to run nginx using the command start nginx. Start nginx command should start the nginx process. You can check the nginx process has been started or not using the tasklist command tasklist /fi "imagename eq nginx.exe". If the nginx process had not been started it will show you some thing like below -


If nginx does not started like above, you can check the reason in the error log file logs\error.log. The reason of nginx not started will be shown below which is nothing but an error "bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)".


To solve this error you need to change the port from 80 to some other port in conf\nginx.conf.


This is because there might be some applications in your system which is running on port 80 like skype. When you change the port to something like 8070 and then start nginx again it will start. You can check nginx is running or not using command tasklist /fi "imagename eq nginx.exe" it will show two nginx processes running.


Please Like and Share CodingDefined.com Blog, if you find it interesting and helpful.

1 comment:

  1. Hi thank you for taking time to mention the reason and the steps. Kudos for the effors. you saved a lot of time for me.

    ReplyDelete