nginx在windows环境下的基本命令
1.cmd进入nginx文件夹
2.启动命令
start nginx
或者
nginx.exe
注:nginx.exe是前台运行,关闭当前命今行窗口时,nginx自动关闭;start nginx是后台运行
3.停止命令
nginx.exe -s stop || nginx.exe -s quit
注:stop是快速停止nginx,可能并不保存相关信息;quit是完整有序的停止nginx,并保存相关信息。
4.重新载入nginx
nginx.exe -s reload
5.查看nginx版本
nginx.exe -v
windows 的配置目录 nginx 1.14: 注意/ 的方向 不是\
root D:/operation/web/dist;
这个很奇葩,遇到问题了,看日志才知道这种问题。
但是1.15以后就没问题呢:
server {
listen 60080;
server_name download.apk.com; #没有使用域名,只是为了好看区分,懂 nginx 的应该知道
charset utf-8;
location / {
root D:\01-soft;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}
server {
listen 60081;
server_name download.img.com;
charset utf-8;
location / {
root D:\02-tools\phpstudy_pro;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}
欢迎来撩 : 汇总all