修改前端部署README

This commit is contained in:
izory 2021-08-23 17:56:19 +08:00
parent a1a4af5f3a
commit f52414db3c

View File

@ -2,10 +2,10 @@
```bash ```bash
# 克隆项目 # 克隆项目
git clone https://gitee.com/y_project/RuoYi-Vue git clone https://gitee.com/izory/ZrAdminNetCore
# 进入项目目录 # 进入项目目录
cd ruoyi-ui cd ZR.Vue
# 安装依赖 # 安装依赖
npm install npm install
@ -17,7 +17,7 @@ npm install --registry=https://registry.npm.taobao.org
npm run dev npm run dev
``` ```
浏览器访问 http://localhost:80 浏览器访问 http://localhost:8887
## 发布 ## 发布
@ -33,16 +33,17 @@ npm run build:prod
``` shell ``` shell
server { server {
listen 8010; #修改要监听的端口
#绑定多个域名 listen 8080;
server_name 127.0.0.1; #修改要绑定的域名或IP地址
server_name localhost;
# charset koi8-r; # charset koi8-r;
access_log logs/logs.access.log main; access_log logs/logs.access.log main;
# 后端接口 生产环境 # 后端接口 生产环境
location /prod-api/ { location /prod-api/ {
proxy_pass http://localhost:8085/; proxy_pass http://localhost:8888/;
# 后端的Web服务器可以通过X-Forwarded-For获取用户真实IP # 后端的Web服务器可以通过X-Forwarded-For获取用户真实IP
proxy_set_header Host $host; proxy_set_header Host $host;
@ -53,13 +54,14 @@ server {
# proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; # proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
} }
# vue 项目 # vue项目配置
location / { location / {
root html/dist; #将xxxxx路径改成你的发布路径
index index.html; root html/zradmin_vue;
try_files $uri $uri/ /index.html; index index.html;
} try_files $uri $uri/ /index.html;
}
error_page 404 /404.html; error_page 404 /404.html;
# redirect server error pages to the static page /50x.html # redirect server error pages to the static page /50x.html