【文件属性】:
文件名称:Nginx使用方法
文件大小:2KB
文件格式:ZIP
更新时间:2021-12-05 07:15:24
Nginx
官网下载:http://nginx.org/en/download.html
cmd命令行:进入nginx安装的跟目录:
cd F:\nginx-1.12.2
执行:
start nginx : 启动nginx服务
nginx -s reload :修改配置后重新加载生效
nginx -s reopen :重新打开日志文件
nginx -t -c F:/nginx-1.12.2/conf/nginx.conf 测试nginx配置文件是否正确
start nginx
nginx -s stop
nginx -s quit
nginx -s reload
nginx -t
修改后的hosts文件放入c:\windows\system32\drivers\etc替换以前的hosts文件:
127.0.0.1 localhost
192.168.3.18 static.com
nginx.conf 配置文件:
server {
listen 80;
server_name 127.0.0.1 localhost;
location / {
root D:/ELK ;
index index.html index.htm;
}
}
server {
listen 8099;
server_name static.com;
location / {
root D:/vueitem ;
index index.html index.htm;
}
}
浏览器访问:
http://localhost/
http://localhost:8088/
http://static.com:8099/
【文件预览】:
Nginx
----hosts(87B)
----nginx.conf(3KB)
----说明.txt(1KB)