mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #591] dashboard运行在web反向代理后面出现重定向错误 #460
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#460
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jimstar06 on GitHub (Jan 7, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/591
Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
What version of frp are you using (./frpc -v or ./frps -v)?
0.14.1
What operating system and processor architecture are you using (
go env)?all platform
Configures you used:
出于安全考虑我想让dashboard运行在caddy服务器后面,使用https反向代理
frps.ini(partial)
Caddyfile
Steps to reproduce the issue:
Describe the results you received:
页面被重定向至https://example.com/static/
Describe the results you expected:
页面被重定向至https://example.com/frp/static/
Additional information you deem important (e.g. issue happens only occasionally):
always happen
Can you point out what caused this issue (optional)
dashboard使用
<a href="/static/">Moved Permanently</a>.重定向,应该使用相对路径static/,后续资源应该使用相对路径访问(static,api等)。如果使用单一域名反向代理dashboard,问题不会出现。
关于反向代理的使用方法参考 netdata wiki的run netdata in a subfolder。
caddy反向代理参考文档
该问题应该影响所有web服务器。
@fatedier commented on GitHub (Jan 17, 2018):
反向代理使用域名来区分网站已经可以了。
个人观点,你想要做 url 路由,那么应该通过自己的方式去完成,比如使用更复杂的配置,甚至自己写代码实现所需的反向代理的功能,而不是要求要反向代理的网站如何去做。一千个人有一千个需求,不可能为了每一个人的需求就去修改正常的功能,也许一个人可以了,其他人又会遇到其他问题。
@tufu9441 commented on GitHub (Apr 20, 2018):
@jimstar06 请教一下,如果您不加proxy的without参数,能用Caddy成功反代frp的dashboard页面吗?我试了没有成功,我同一个域名下的/路径反代的是vhost_http_port端口,想再设置一个/frp路径来反代dashboard_port就不行了……
@jimstar06 commented on GitHub (Apr 24, 2018):
子目录反代不成功的原因是访问"example.com/frp"时返回重定向至绝对路径"/static",同时部分资源和api接口在绝对路径"/api"下,服务器需要手动反代这几个路径,我不想这么干
@tufu9441 commented on GitHub (Apr 24, 2018):
@jimstar06 原来如此,那我也就不折腾这个了。
@owen-gxz commented on GitHub (Jul 13, 2020):
@jimstar06 我80端口被caddy代理到frp上然后本地使用吗?
我本地需要xxx:22601才可以访问,但是微信那便必须使用80或者443端口才可以这时候怎么来操作
@weycen commented on GitHub (Feb 11, 2026):
遇到了同样的问题,好像只能通过端口方式了