LocalWP shutdown leaves nginx server running

What issue or error are you experiencing?

When I run LocalWP on my win 11 machine, I first shut down IIS, then run local. LocalWP sites run fine. When I shutdown the site inside of local, close the localWP application itself, and restart IIS, requests are still being handled by LocalWp’s nginx server and I get the nginx 404 page. I then use task manager to kill the nginx server but IIS still does not handle any requests when it is running. The only way I’ve been able to re-enable IIS is to do a hard restart of the Win 11 machine. This is pretty awful for workflow. Not sure if there are things I should be looking into here or if this is partly a LocalWP issue as well. Any thoughts?

System Details

  • Local Version:
    Version 0.0.2+6676

  • Operating System (OS) and OS version:
    Windows 11 Pro 23H2


sorry - local version: 9.0.2+6676

Hey @drikfan – Thanks for writing in and sorry that this is happening it definitely sounds frustrating!

I tried replicating this on my Windows VM running Win Pro 11 – Version 10.0.22631 Build 22631 and didn’t experience that. The things I tried:

  • Start Local, create a new site, quit Local from the “x” in the upper right corner of the app. Works without any Nginx processes remaining in System Monitor.
  • Start Local, create a site, connect to it via Chrome and Bing, quit Local. My thinking was that maybe a browser was somehow preventing the process from closing cleanly. Works, no nginx processes remaining.
  • Start Local, create a new custom site with different PHP version, Apache, and MariaDB. Connect to the site with Chrome/Bing and then quit Local. Even with an apache WordPress site, an Nginx process will run as the “Router” which is basically just an nginx proxy to direct individual requests to the specific port that each site is listening on. This works with no Nginx processes working.

Can you describe in a little more detail how you are using Local, the kind of sites that are running, and if there are any security settings or antivirus software that might be preventing Local from stopping its processes?

Also, can provide the Local Logs so we can get a better idea if Local is logging any issue? You can get a zip of those logs by clicking the “Download Local Log” button from the “Support” tab of Local. See this help doc for more information:

Sure Thing!

General use/workflow is that I have a site hosted on WPengine. I pull that site down using LocalWp to push/pull from said environment for local dev. I’m just running custom developed wordpress theme based sites. From a security perspective I’m running just default/ out of the box Windows 11 Pro Security which does include a firewall by default

The Issue:
When I am finished with my local development, I close the application using the “Stop Site” Button in the upper right, and then close the LocalWp application. Often (but not always) this will leave an nginx.exe process running which interferes with IIS when I restart it (I close IIS before opening and working with LocalWP).

Interestingly, while this leftover nginx process is running, if I re-open the LocalWP app, the nginx server gets shut down. It seems that maybe the process is not getting shut down somehow when initially closing LocalWP. Also of note, when i “start site” in LocalWp, 2 separate nginx processes are started. When I “Stop site”, one of those processes is shut down, the other is not. I’ve also tried running LocalWP as an administrator and it behaves the same.

Note that I have found a workaround, and now that I’m aware of this issue its not critical or anything, but wanted to give you all this info in case it is helpful in any way.

Ive included recent logs below as well.
local-logs1.zip (90.2 KB)