1. a.下载windows版nginx (),并且下载注册服务工具,
b.下载地址: 下载该工具后,将其放在 Nginx安装目录下,并重命名为nginx-service.exe
c.创建配置文件nginx-service.xml(名字要和工具名一样),创建nginx-service.exe.config(为支持NET 4.0 runtime,默认只支持NET 2.0 runtime)
2.nginx-service.xml 内容如下:(其中的路径地址是nginx.exe的目录,不能是中文目录)
<service> <id>nginx</id> <name>Nginx Service</name> <description>High Performance Nginx Service</description> <logpath>D:\nginx\nginx-1.5.1\logs</logpath> <log mode="roll-by-size"> <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <executable>D:\nginx\nginx-1.5.1\nginx.exe</executable> <startarguments>-p D:\nginx\nginx-1.5.1</startarguments> <stopexecutable>D:\nginx\nginx-1.5.1\nginx.exe</stopexecutable> <stoparguments>-p D:\nginx\nginx-1.5.1 -s stop</stoparguments> </service>