Nginx is unable to bind to 443

January 31, 2015 28.4k views

Hi all, I have been trying to bind my nginx to port 443. The config file works fine however when i type sudo nginx i repeatedly get address is in use on the bind. I have then used netstat which claims nginx is using the port yet nginx is actually saying it’s not binding.

/etc/nginx/sites-available$ sudo netstat -pan | grep “:443”
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3448/nginx
/etc/nginx/sites-available$ sudo nginx
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()

I have killed all Nginx processes and started up a new nginx copy. rebooted the server to no avail…

Any ideas on what i can do next?

Thanks

6 Answers

sudo fuser -k 443/tcp
service nginx restart

What happens when you run sudo fuser -k 443/tcp?
I am working with Docker running Nginx get that error inside the container. I cannot run that command because my Docker items run on 443. How do I fit the error in a Docker Container?

  • sudo fuser -k 443/tcp
    

    finds processes using files or socket (in this case TCP port 443) and KILLS them using the -k attribute

Case Closed: You need to create an upstream proxy to get node.js to proxy via Nginx.

Thanks to everyone who helped on IRC! <3

worked for me aswell :D

Hello I am facing above issue :

nginx: [warn] the “user” directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

PLEASE HELP ME FOR THE SAME.ITS DEPEND ON MY JOB.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!