英文:
How to stop nginx for windows?
问题
无法停止Windows上的nginx服务器。我尝试过:nginx -s stop
,taskkill /if nginx.exe
,以及通过任务管理器结束进程,但它仍在运行!
英文:
I can't stop the nginx server on windows. I've tried: nginx -s stop
, taskkill /if nginx.exe
, and end process via task manager, yet it's still running!
答案1
得分: 57
Use @taskkill /f /im nginx.exe
完成此任务。
英文:
Use @taskkill /f /im nginx.exe
for this task.
答案2
得分: 43
你可以停止使用 quit
> nginx.exe -s quit
英文:
You can stop using quit
>nginx.exe -s quit
答案3
得分: 13
One can toggle Nginx start stop in Windows using 2 command prompts. One for Nginx start and other for Nginx Stop.
If you stop Nginx from one command prompt then the Nginx process which was started from other prompt will automatically stop, Otherwise if you try to stop the Nginx process from where it started using ctrl+c then it will not stop even though you close the command prompt, Unless you kill the nginx processes from TaskManager.
英文:
One can toggle Nginx start stop in Windows using 2 command prompts. One for Nginx start and other for Nginx Stop.
If you stop Nginx from one command prompt then the Nginx process which was started from other prompt will automatically stop, Otherwise if you try to stop the Nginx process from where it started using ctrl+c then it will not stop even tough you close the command prompt, Unless you kill the nginx processes from TaskManager.
答案4
得分: 4
Starting nginx with daemon off
will do the trick.
nginx is detached from the console by default, independently if you run it directly using ./nginx.exe
or (as suggested by the guide) using start ./nginx.exe
.
if you wanna stay coupled with the process who run the nginx (so it can pass the SIGTERM / CTRL+C to the nginx) you have to run this command:
nginx -g "daemon off;"
英文:
Starting nginx with daemon off
will do the trick.
nginx is detauched from the console by default, independently if you run it directly using
./nginx.exe
or (as suggested by the guide) using
start ./nginx.exe
if you wanna stay coupled with the process who run the nginx (so it can pass the SIGTERM / CTRL+C to the nginx) you have to run this command:
nginx -g "daemon off;"
答案5
得分: 1
这对我有用
wmic process where name='nginx.exe' delete
英文:
This worked for me
wmic process where name='nginx.exe' delete
答案6
得分: 1
Create一个**.bat文件在nginx.exe**文件夹中,使用以下命令:nginx.exe -s quit
。然后创建一个桌面或其他需要的快捷方式。
英文:
Make a .bat file in the nginx.exe folder with the command: nginx.exe -s quit
. Then make a shortcut to desktop or whereever needed.
答案7
得分: 0
我们可以按照下面提到的步骤来退出或重新加载nginx,如果遇到如下问题:
nginx: [error] CreateFile() "...logs/nginx.pid" 失败
(2: 系统找不到指定的文件)
英文:
We can follow the steps motioned below to quit or reload the nginx if facing any issue like.
nginx: [error] CreateFile() "...logs/nginx.pid" failed
(2: The system cannot find the file specified)
答案8
得分: 0
如果您通过Docker运行,可以在单独的窗口中输入类似以下内容的命令:
docker system prune
英文:
If you run via docker, you can type something like this in a separate window:
docker system prune
答案9
得分: 0
我在这个网站上找到了解决方案。
以下是拯救我的部分!
(也许)确保以管理员身份运行。
一旦我以管理员身份运行PowerShell,
TASKKILL /F /IM nginx.exe
终止它们全部,它们就不再返回。
我还注意到任务管理器中的“nginx-FMWS50.exe”,我不知道为什么。
我所做的是将相同的命令更改为
TASKKILL /F /IM nginx_FMWS50.exe
嘭!它奏效了!
英文:
I found a solution in from this site
Below is the part that save my day!
(also maybe) Be sure to run as admin.
Once I run the Powershell as Administrator,
TASKKILL /F /IM nginx.exe
terminate them all and they never return.
I also realize "nginx-FMWS50.exe" at the task-manager which I don't know why.
What I did was I alter the same command to
TASKKILL /F /IM nginx_FMWS50.exe
BOOM! It works!
答案10
得分: -1
Create a Windows shortcut and add the following to the target box:
C:\Windows\System32\cmd.exe /k "wmic process where name='nginx.exe' delete" && exit
Double-clicking it will shut down Nginx.
英文:
Make a windows shortcut somewhere and add the following in the target box:
C:\Windows\System32\cmd.exe /k "wmic process where name='nginx.exe' delete" && exit
Anytime you double clicked, nginx get shut down.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论