版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39759115/article/details/83615844
安装
下载地址:http://nginx.org/en/download.html
下载解压到 D:nginx/
CMD运行命令:
D:
cd nginx
start nginx
Nginx基础命令
查看nginx的版本号:nginx -v
验证配置是否正确: nginx -t
启动命令:start nginx
快速停止命令:nginx -s stop
正常停止命令:nginx -s quit
配置文件修改重载命令:nginx -s reload
配置
打开 conf 目录下的 nginx.conf 文件,并进行配置
// 最简单的反向代理 node 地址 http://localhost:8081;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:8081;
}
}