前端部署流程:
- 安裝nginx
參考鏈接: https://www.cnblogs.com/fengkun125/p/14142912.html
參考第一種安裝方式
- 將dist.zip放到任意文件夾下解壓
unzip dist.zip
- 拿到解壓后文件夾的當前文件目錄: pwd
例如: /home/dist
- 打開nginx配置文件 nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok (配置文件地址)
nginx: configuration file /etc/nginx/nginx.conf test is successful
打開配置文件 vi /etc/nginx/nginx.conf
修改配置文件 下面為需要修改的部分
server {
listen 8083; // 這個是暴露的端口號炸站,需要在騰訊云或者阿里云上放開端口訪問
server_name localhost; // 不變
autoindex on; // 不變
location / {
root /home/dist; // 這個就是你通過pwd拿到的地址
index index.html index.htm;
}
}
- 重啟nginx