A flaw in Nginx for Windows

Source: Internet
Author: User

According to the official web site, using the start Nginx to start Nginx, using Nginx-s quit can gracefully exit.

After the experiment, using the start Nginx, will start two nginx process, according to the official network, one is the control process, one is the work process (a processes is the master process and another is the Worker process.).

When we start the process, Nginx can start working now, but when we use the start nginx again, we will find that we have started two more processes.

Now we use Nginx-s quit command, will find that there are still two processes left, then use Nginx-s quit, will be error ah ... , but there are now two nginx.exe processes. Use Nginx-s reload, also will error.

The problem with this phenomenon is that if I accidentally use the two-time start nginx, that actually listens on 80 port (or other port) is the first boot, so when I modify the configuration file and then Nginx-s reload, I will find that the configuration file modification does not work. Then use Nginx-s quit to gracefully exit, you will find Nginx can still use.

The workaround is to use the Taskkill command to force the terminating process.

Why this kind of problem arises, observe + guess:

When the start Nginx command is used, the./logs/nginx.pid file is created, and the Nginx.exe PID is recorded, and when the start Nginx is reused, the contents of the nginx.pid are replaced by the latter, so Nginx.ex E doesn't know what the PID of the process that was started before. The nginx.exe processes that were initiated before have been abandoned by Nginx.exe (and adopted by the system, #_ #).

A flaw in Nginx for Windows

Related Article

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.