nginx: [emerg] bind() to x.x.x.x:80 failed (99: Cannot assign requested address)

rezapj

Verified User
Joined
Nov 30, 2021
Messages
9
after updates my nginix cannot run for following error

nginx: [emerg] bind() to x.x.x.x:80 failed (99: Cannot assign requested address)

this x.x.x.x is not my vps ip
and when i try ./build rewrite_confs
Using x.x.x.x for your server IP
Using x.x.x.x for your server IP
Restarting nginx.
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

where is this ip ... i want change with my vps ip maybe fixed
but its my problem now
 
Try changing that IP using ipswap.sh:
Code:
/usr/local/directadmin/scripts/ipswap.sh x.x.x.x your_real_ip
 
Hi guys,
I have the same problem i tried all the above but is not working only if i disable ipv6 ( ipv6=0 i) nginx starts.

[emerg] 466782#0: bind() to [::1]:80 failed (99: Cannot assign requested address)
[emerg] 519848#0: bind() to [::1]:80 failed (99: Cannot assign requested address)
[emerg] 526090#0: bind() to [::1]:80 failed (99: Cannot assign requested address)

thank you
 
Hi guys,
I have the same problem i tried all the above but is not working only if i disable ipv6 ( ipv6=0 i) nginx starts.

[emerg] 466782#0: bind() to [::1]:80 failed (99: Cannot assign requested address)
[emerg] 519848#0: bind() to [::1]:80 failed (99: Cannot assign requested address)
[emerg] 526090#0: bind() to [::1]:80 failed (99: Cannot assign requested address)

thank you
I get the same error and to get nginx bak up&runing I have to edit /etc/nginx/nginx-vhosts.conf and replace

listen [::1]:80
with
listen *:80;

after that I can restart nginx, but it's an manual workaround

Question: how to fix the error permanently?
 
if you enable IPv6 in system - DA will try to use it in virtual hosts, so you must have UP and running this IP on ethernet interface.
If you don't have it - disable it and rewrite confs.
 
nano /etc/sysctl.conf


net.ipv6.conf.all.disable_ipv6 = 1
kernel.panic = 10
net.ipv4.ip_nonlocal_bind = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

sysctl -p

yet, it's still the same. what else do I need to update?
 
Back
Top