nginx停止/重新加载窗口失败的访问被拒绝

我在Windows Server 2008 R2(x64)上运行nginx作为Windows服务。 我正在使用Windows服务包装。 (其实,我已经按照这个教程: http : //mercurial.selenic.com/wiki/HgServeNginxWindows 。)

该服务运行正常。 但是,服务器不处理信号(例如停止/重新加载)。

这意味着如果我停止服务,nginx不会停止。 (我必须杀死它)

而当我想从命令行重新加载configuration时:

C:\Users\Administrator>E:\apath\nginx\nginx.exe -p E:\apath\nginx -c E:\apath\nginx.conf -s reload 

它输出:

 nginx: [error] OpenEvent("Global\ngx_reload_4268") failed (5: Access is denied) 

我以pipe理员身份运行命令,服务正在NETWORK SERVICE用户下运行。

任何提示或类似的问题?

一些事情要尝试:

  1. 为什么要在NETWORK SERVICE帐号中运行? 尝试使用所有服务的默认设置LocalSystem。

  2. 按照这个教程来尝试另一个包装,AlwaysUp 。 如果有效,那么您可能会遇到Windows Service Wrapper的问题。

请报告你find的。

我在LOCAL SYSTEM下运行我的nginx服务,并使用下面的xmlconfiguration:

 <service> <id>nginx-service</id> <name>nginx-service</name> <description>nginx-service</description> <executable>c:\nginx\nginx.exe</executable> <logpath>c:\nginx\</logpath> <logmode>roll</logmode> <depend></depend> <startargument>-pc:\nginx</startargument> <stopexecutable>c:\nginx\nginx.exe</stopexecutable> <stopargument>-s</stopargument> <stopargument>stop</stopargument> </service> 

我正在使用Windows Service Wrapper 1.18,这个configuration适用于我。 Nginx进程应该现在停止优雅。 祝你好运。

为了在Windows 10上为我工作,使用nginx 1.9.15我必须添加

 -pc:\nginx 

在停止参数

 <service> <id>nginx</id> <name>nginx</name> <description>nginx</description> <executable>c:\nginx\nginx.exe</executable> <logpath>c:\nginx\</logpath> <logmode>roll</logmode> <depend></depend> <startargument>-p</startargument> <startargument>c:\nginx</startargument> <stopexecutable>c:\nginx\nginx.exe</stopexecutable> <stopargument>-p</stopargument> <stopargument>c:\nginx</stopargument> <stopargument>-s</stopargument> <stopargument>stop</stopargument> </service>