Skip to content

Gopeed Web 反向代理子路径下无法加载资源文件 #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yeziruo233 opened this issue Apr 16, 2025 · 2 comments · May be fixed by #1001
Open

Gopeed Web 反向代理子路径下无法加载资源文件 #1000

yeziruo233 opened this issue Apr 16, 2025 · 2 comments · May be fixed by #1001
Labels
enhancement New feature or request

Comments

@yeziruo233
Copy link

yeziruo233 commented Apr 16, 2025

Nginx 主要配置如下:

location /gopeed/ {
    proxy_pass http://127.0.0.1:8082/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

访问http://<ip>/gopeed/并不会出现Gopeed的界面,F12有两个资源文件报错:

404 https://<ip>/flutter_bootstrap.js
404 https://<ip>/manifest.json

理论上它们的正确访问路径为:

https://<ip>/gopeed/flutter_bootstrap.js
https://<ip>/gopeed/manifest.json

然后我看到网页源代码有这样的提示:

If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.

The path provided below has to start and end with a slash "/" in order for
it to work correctly.

For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.

于是我按照提示本地缓存替换修改了一下,现在正常工作:

<base href="/gopeed/">

有什么办法能够解决这个问题吗?

@monkeyWie monkeyWie added the enhancement New feature or request label Apr 16, 2025
@monkeyWie
Copy link
Member

目前好像没啥办法,等下个版本我调整下基础路径

@monkeyWie monkeyWie linked a pull request Apr 17, 2025 that will close this issue
@yeziruo233
Copy link
Author

感谢大佬回复!此外API的路径好像也有问题:

404 https://<ip>/api/v1/config
200 https://<ip>/gopeed/api/v1/config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants