Applicable to:
- Plesk for Linux
Symptoms
-
After system reboot, the websites do not load with the error:
PLESK_INFO: ERR_ADDRESS_UNREACHABLE
-
nginx service is in the failed state:
# service nginx status
...
Active: failed (Result: exit-code)
...
server.edhub.net nginx[1104]: nginx: [emerg] bind() to [2400:8901::f03c:91ff:fe24:7893]:443 failed (99: Cannot assign requested address) -
Manual restart of the service is successful:
# service nginx start
# service nginx status | grep Active
Redirecting to /bin/systemctl status nginx.service
Active: active (running)
Cause
During the system boot, nginx service was started before IP addresses were assigned to the network interface.
Resolution
- Connect to your Plesk server via SSH.
-
Verify that network interfaces are enabled on system boot:
# grep -r "ONBOOT" /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-lo:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-venet0:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-venet0:0:ONBOOT=yes -
Create a copy of the nginx startup script
/etc/systemd/system/multi-user.target.wants/nginx.service:# cp /etc/systemd/system/multi-user.target.wants/nginx.service{,.bak}
-
Install the
systemd-networkdpackage, if it is not installed:# yum install systemd-networkd
-
Open nginx startup script in a text editor. For example, vi editor:
# vi /etc/systemd/system/multi-user.target.wants/nginx.service
-
Add the following line to the
[Unit]section:CONFIG_TEXT: After=network-online.target remote-fs.target nss-lookup.target
- Save the changes and close the file.
-
Reboot the server:
# reboot
- Connect to your Plesk server via SSH.
-
Verify that network interfaces are enabled on system boot:
# grep auto /etc/network/interfaces
# This configuration file is auto-generated.
auto lo
auto venet0
auto venet0:0 -
Create a copy of the nginx startup script
/etc/systemd/system/multi-user.target.wants/nginx.service:# cp /etc/systemd/system/multi-user.target.wants/nginx.service{,.bak}
-
Open nginx startup script in a text editor. For example, vi editor:
# vi /etc/systemd/system/multi-user.target.wants/nginx.service
-
Add the following line to the
[Unit]section:CONFIG_TEXT: After=network-online.target remote-fs.target nss-lookup.target
- Save the changes and close the file.
-
Reboot the server:
# reboot
-
Check nginx status:
# service nginx status | grep Active
If nginx service did not start after the system restart with the new changes, apply additional step:
-
Add the following line in
[Service]section in/etc/systemd/system/multi-user.target.wants/nginx.servicefile:CONFIG_TEXT: ExecStartPre=/bin/sleep 10
Note: Increase the value, if 10 seconds timeout is insufficient.
-
Reboot the server:
# reboot
Comments
Please sign in to leave a comment.