上一篇用了tomcat部署(https://blog.csdn.net/yueyekkx/article/details/105491363),
还是觉得nginx是王道话不多说开始:
还是windows下部署:
nginx jar包
前端:
1.1前端一样:
运行代码:npm run build:prod
生成一个dist文件夹
后端:
打成jar包
maven打包 :按照1,2,3步骤,输入命令
clean package -Dmaven.test.skip=true
项目目录下会产生target文件夹,内有ruoyi.jar文件。
开始部署:
nginx下载解压版,解压
修改conf下的nginx.conf文件
server {
listen 80;
server_name localhost;
location / {
root F:/RuoYi-Vue/ruoyi-ui/dist/;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /prod-api/{
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $rem