Skip to content

Commit

Permalink
🐎 ci: 修改nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanjunjie committed Jul 3, 2024
1 parent f10f938 commit cc86485
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vue-vben-admin/.env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ VITE_DROP_CONSOLE = true
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'none'
VITE_GLOB_API_URL="__vg_base_url"
VITE_GLOB_API_URL="/v1/api"

# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=/files/upload
VITE_GLOB_UPLOAD_URL=/v1/api/oss/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
2 changes: 0 additions & 2 deletions vue-vben-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ EXPOSE 80
COPY --from=builder /app/dist /usr/share/nginx/html

## 将/usr/share/nginx/html/dist/assets/index.js 和/usr/share/nginx/html/dist/_app.config.js中的"$vg_base_url"替换为环境变量中的VG_BASE_URL,$vg_sub_domain 替换成VG_SUB_DOMAIN,$vg_default_user替换成VG_DEFAULT_USER,$vg_default_password替换成VG_DEFAULT_PASSWORD 而后启动nginx
# CMD sed -i "s|__vg_base_url|$VG_BASE_URL|g" /usr/share/nginx/html/dist/assets/entry/index-*.js /usr/share/nginx/html/dist/_app.config.js && \
# nginx -g 'daemon off;'

RUN echo "🎉 架 🎉 设 🎉 成 🎉 功 🎉"
4 changes: 4 additions & 0 deletions vue-vben-admin/_nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ http {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}

location /v1/api {
proxy_pass http://servers:9001;
}
}
}

0 comments on commit cc86485

Please sign in to comment.