主要是路径的问题
例如 include C:\\nginx\\conf\\xxxxx\\*.conf;
这样是不行的
include C:\nginx\conf\xxxxx\*.conf;
这样也是不行的
正确的:
include C:\\nginx\\conf\\xxxxx/*.conf;
或者 include C:/nginx/conf/xxxxx/*.conf;
这样才行。。
报错:
[emerg] 30908#69720: CreateFile() "xxxx.conf" failed (2: The system cannot find the file specified) in C:\nginx/conf/nginx.conf:42
另外文件最好是对应的编码格式,utf-8 no bom
另外访问日志会越来越大的处理
编写脚本如下:
taskkill /F /IM nginx.exe
set "cmdstr=move C:\nginx\logs\access.log C:\nginx\logs\access.%date:~0,4%-%date:~5,2%-%date:~8,2%.logcall %cmdstr%"
net start nginx
参考:https://segmentfault.com/a/1190000006807506
https://www.cnblogs.com/allanhboy/archive/2011/11/10/2244461.html