Nginx failed to start and bind

Nginx cannot start because apache uses 80 port.
What should be in the conf files in Listen part? I think for nginx there should be just localhost. Am i right?

2022/10/13 11:02:02 [emerg] 9121#9121: bind() to xxx:8080 failed (98: Address already in use)
2022/10/13 11:02:02 [emerg] 9121#9121: bind() to xxx:8080 failed (98: Address already in use)
2022/10/13 11:02:02 [emerg] 9121#9121: bind() to xxx:8080 failed (98: Address already in use)
2022/10/13 11:02:02 [emerg] 9121#9121: bind() to xxx:8080 failed (98: Address already in use)
2022/10/13 11:02:02 [emerg] 9121#9121: bind() to xxx:8080 failed (98: Address already in use)
2022/10/13 11:02:02 [emerg] 9121#9121: still could not bind()

Probally you are using a template for Nginx as web but using Nginx + Apache2

1 Like

Found solution. In my case all the nginx conf files where bind to 80 or 8084 ports except one - there was binding to 8080 port. It was generated from template for octobercms i just installed. I changed port to 8084 in conf file and problem has gone.

Probally you want to update the template you are using

from: web_port to proxy_port (And the stpl the same only web_port_ssl)

1 Like

You are right. There is web_ssl_port and web_port in templates. Have to change them there. Will push PR on github.
Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.