一、安装Nginx教程
1、官网下载地址:https://nginx.org/en/download.html
2、下载教程:选择Stable version版本下载到本地

3、下载完成后,解压放入本地非中文的文件夹中:

4、启动nginx:双击nginx.exe,若双击未弹出内容,则说明端口被占用,请参照第6步

或者使用命令行:输入start nginx

5、查看是否启动成功:在浏览器输入:https://localhost,能看到界面说明启动成功

6、打开conf文件夹下的nginx.conf查看端口占用情况:
(1)nginx默认使用80端口

(2)端口被占用则自定义端口:

二、部署Nginx教程
1、将打包的dist文件放入与nginx-1.22.0同级的html文件夹中,或指定root


Windows版本的nginx常用命令一览:
命令需在nginx的安装根目录下运行:
启动 | start nginx |
---|---|
停止 | nginx -s stop 或者 nginx -s quit |
重新加载配置文件 | nginx -s reload |
查看版本 | nginx -v |
终止nginx进程 | taskkill /f /t /im nginx.exe |