This is documentation for an outdated product. See the current documentation

ISPmanager 5 Lite Documentation

/
/
/
If Nginx does not start after rebooting the server

If Nginx does not start after rebooting the server

 

Probable reasons why Nginx does not start after reboot:

  • Nginx is not added to autostart;
  • Nginx starts before network services are loaded. In this case, it is necessary to delay the launch of Nginx.

How to add Nginx to autostart

  1. Execute the command:
    systemctl enable nginx
  2. Reboot the server and check if Nginx is running:
    service nginx status

How to delay the launch of Nginx

Method 1

  1. Replace the line /etc/systemd/system/multi-user.target.wants/nginx.service in the configuration file Nginx
    After=network.target remote-fs.target nss-lookup.target
    with
    After=network-online.target remote-fs.target nss-lookup.target
  2. Reboot the server and check if Nginx is running:
    service nginx status

Method 2

  1. Add the string to the Nginx Service section configuration file /etc/systemd/system/multi-user.target.wants/nginx.service
    ExecStartPre=/bin/sleep <time>
    Comments
  2. Reboot the server and check if Nginx is running:
    service nginx status