Nginx restart failure prompt: nginx. pid cannot be found

Source: Internet
Author: User

Restart nginx:/usr/local/nginx/sbin/nginx-s reload
Error code:Nginx: [error] open () "/usr/local/nginx/logs/nginx. pid" failed (2: No such file or directory) (as shown below)




Solution:

1. Run/usr/local/nginx/sbin/nginx again.
2. Restart nginx:/usr/local/nginx/sbin/nginx-s reload

Some of the above solutions can be solved by some friends, but most of the data cannot be solved, so google searches

Take a look

Issued a nginx-s stop and after that I got this error when trying to reload it.

[Error]: invalid PID number "" in "/var/run/nginx. pid"

That/var/run/nginx/pid file is empty atm.

What do I need to do to fix it?


Nginx-s reload is only used to tell a running nginx process to reload its config. after a stop, you don't have a running nginx process to send a signal. just run nginx (possibly with a-c/path/to/config/file)

So I used this method, that is

Nginx-c/path/to/config/file) // This is the case on my machine:/alidata/server/nginx/sbin/nginx-c/alidata/server/nginx/conf/nginx. conf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.