第一步:下载Nginx
下载 官网:https://nginx/en/download.html
下载Windows Service Wrapper
下载 官网:https://repo.jenkins-ci/artifactory/releases/com/sun/winsw/winsw/
配置
假设nginx解压到目录:D:\Applications\WebServer\nginx-1.18.0
将下载下的winsw.exe放到位置D:\Applications\WebServer\nginx-1.18.0,然后在该路径下创建文件winsw.xml:
注意:必须解压到Nginx根目录
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx Web Server</description>
<executable>D:\Applications\nginx1.26.2\nginx.exe</executable>
<stopexecutable>D:\Applications\nginx1.26.2\nginx.exe -s stop</stopexecutable>
<logpath>D:\Applications\nginx1.26.2\logs</logpath>
<logmode>roll</logmode>
</service>
运行
打开命令行工具,在其中执行winsw.exe install
,回车,提示安装服务完成。
发布者:admin,转转请注明出处:http://www.yc00.com/web/1740841863a4261967.html
评论列表(0条)