吴 (@wardward) 在 nginx -s reload 出现 nginx: [error] OpenEvent("Global\ngx_reload_45460") failed (5: Access is denied)的问题的解决方案 中发帖
一、问题
问题如下:
[Pasted image 20251011171424]
当使用nginx -s reload是会提示你的权限不够,nginx: [error] OpenEvent(“Global\ngx_reload_45460”) failed (5: Access is denied)
二、分析
这种问题一般都是使用choco安装nginx导致的choco install nginx,会导致你无法使用nginx -s reload。
你会发现choco自动安装好的nginx是依赖于nssm,所以说你不能使用nginx的原生命令来解决问题。
三、解决思路
所以你应该输入
nssm restart nginx
来重载配置文件。
[图片]
启动nginx
nssm start nginx
停止nginx
nssm stop nginx