admin管理员组

文章数量:1435859

第一步:下载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,回车,提示安装服务完成。

本文标签: nginxWindows