ISPmanager 5 Lite Documentation

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

    <time> — start delay in seconds. It is recommended to set the start delay of 10 seconds.

  2. Reboot the server and check if Nginx is running:

    service nginx status
Thank you for your feedback!
Was the article useful?
Tell us why not:

it does not match the title

it was hard to understand

I didn't find the answer

recommendations from the article did not help

other

Tell us what you didn't like in the article: