反向代理子路径支持实现 - #1087
Open
yomiel-s wants to merge 10 commits into
Open
Conversation
- index.html: use Jinja2 {{ base_path }} for /images/ and /fonts/ URLs
- vite.config.ts: dev plugin replaces all {{ base_path }} occurrences
- new base-path.ts utility function
- ab-topbar.vue, login.vue: use basePath() for image src
- main.py: dynamic PWA manifest route with base path injection
|
@yomiel-s is attempting to deploy a commit to the estrellaxd's projects Team on Vercel. A member of the Team first needs to authorize it. |
Release 3.3.5
Release 3.3.5 (mypy fix)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
通过
AB_ROOT_PATH环境变量实现运行时动态 base path,支持 nginx/traefik 反向代理子路径部署。改动文件
backend/src/main.pyAB_ROOT_PATH,FastAPIroot_path,Jinja2 注入,PWA manifest 动态路由webui/index.html/images/、/fonts/绝对路径改用{{ base_path }}前缀webui/vite.config.tswebui/src/utils/base-path.tsbasePath()工具函数webui/src/utils/poster.ts__BASE_PATH__拼接webui/src/components/layout/ab-topbar.vuewebui/src/pages/login.vuewebui/types/dts/vite-env.d.tsWindow.__BASE_PATH__类型声明使用方式
docker run -e AB_ROOT_PATH=/bangumi auto_bangumi nginx 配置: location /bangumi/ { proxy_pass http://127.0.0.1:7892/; }不设置 AB_ROOT_PATH 时行为与旧版完全兼容。
测试
RFC Issue: 反向代理子路径支持