需要你手动操作:下载并上传 Nginx 安装包到服务器
将本地的 frontend/dist 目录上传到服务器。
本地路径: d:/AI开发/CodeBuddy/DRG医保控费预警系统开发项目/frontend/dist
上传方式(任选一种):
需要你手动操作:将 dist 目录上传到服务器
解压 Nginx
nginx-1.24.0.zip 解压到 C:\nginx创建前端目录
mkdir C:\nginx\html\dist
将上传的 dist 目录中的所有文件复制到 C:\nginx\html\dist\
配置 Nginx
用记事本打开 C:\nginx\conf\nginx.conf
将本项目的 nginx.conf 文件内容复制并替换原内容
保存文件
需要你手动操作:解压、配置 Nginx
cmd
cd C:\nginx
启动 Nginx
start nginx
或访问:http://localhost
常用 Nginx 命令
nginx -s reload # 重新加载配置
nginx -s stop # 快速停止
nginx -s quit # 优雅停止
需要你手动操作:启动 Nginx 服务
如果无法从外部访问,需要开放端口 80:
80需要你手动操作:配置防火墙规则
部署完成后,在浏览器中访问:
应该能看到 DRG 医保控费预警系统的登录页面。
netstat -ano | findstr :80nginx.conf 中的 listen 80 为其他端口(如 8080)C:\nginx\html\dist 目录是否存在index.html 是否在 dist 目录中nginx.conf 中已配置 try_files $uri $uri/ /index.html;如果需要重新构建前端:
cd "d:/AI开发/CodeBuddy/DRG医保控费预警系统开发项目/frontend"
npm run build
构建完成后,新的 dist 目录会生成,需要重新上传到服务器。
如有问题,请联系系统管理员。