mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4198] [Feature Request] 我现在想使用URL路由 根据访问的路由代理到不同的服务器,比如 访问www.baidu.com:8060/aaa 代理到本机1.100的80端口,访问www.baidu.com:8060/bbb代理到本机1.110的80端口.服务… #3305
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#3305
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 @WWTBNBWN on GitHub (May 2, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4198
Describe the feature request
我现在想使用URL路由 根据访问的路由代理到不同的服务器,比如 访问www.baidu.com:8060/aaa 代理到本机1.100的80端口,访问www.baidu.com:8060/bbb代理到本机1.110的80端口.服务器端和客户端怎么配置呢 请教
Describe alternatives you've considered
No response
Affected area
@xqzr commented on GitHub (May 3, 2024):
https://gofrp.org/zh-cn/docs/features/http-https/route/
@WWTBNBWN commented on GitHub (May 4, 2024):
我看着文档配置过一次。我就是上述配置
frps
bindPort = 7000
#tcpmuxHTTPConnectPort = 8099
vhostHTTPPort = 8090
frpc
serverAddr = "88.88.88.88"
serverPort = 7000
frpc.toml
webServer.addr = "127.0.0.1"
webServer.port = 7002
webServer.user = "admin"
webServer.password = "admin"
proxies
name = "bbb"
type = "http"
localPort = 80
localIP = "192.168.1.164"
customDomains = ["www.aaa.aaa"]
remotePort = 8090
locations = ["/bbb"]
proxies
name = "aaa"
type = "http"
localPort = 80
localIP = "192.168.1.108"
remotePort = 8090
customDomains = ["www.aaa.aaa"]
locations = ["/aaa"]
访问浏览器 www.aaa.aaa:8090/aaa 页面直接提示
Access Error: 404 -- Not Found
Can't locate document: /aaa
frps的日志
2024/05/04 08:05:37 [I] [service.go:563] [f858b1a9b5d18616] client login info: ip [121.14.15.87:45791] version [0.53.2] hostname [] os [windows] arch [amd64]
2024/05/04 08:05:37 [I] [http.go:110] [f858b1a9b5d18616] [aaa] http proxy listen for host [www.aaa.aaa] location [/aaa] group [], routeByHTTPUser []
2024/05/04 08:05:37 [I] [control.go:401] [f858b1a9b5d18616] new proxy [aaa] type [http] success
2024/05/04 08:05:37 [I] [http.go:110] [f858b1a9b5d18616] [bbb] http proxy listen for host [www.aaa.aaa] location [/bbb] group [], routeByHTTPUser []
2024/05/04 08:05:37 [I] [control.go:401] [f858b1a9b5d18616] new proxy [bbb] type [http] success
@xqzr commented on GitHub (May 4, 2024):
@WWTBNBWN commented on GitHub (May 4, 2024):
结果一样的,浏览器也是提示Access Error: 404 -- Not Found
Can't locate document: /aaa
我试了。还有什么其他的方案吗 不能使用nginx还有其他的吗 谢谢
@xqzr commented on GitHub (May 4, 2024):
看起来是 本地服务返回的错误
你的场景 可能需要 frpc 改写请求路径(
/aaa或/bbb改写为/)再请求 本地服务,而 frpc 没有这个功能。可以让本地服务适应。另外,可以看看使用端口 路由它们
@WWTBNBWN commented on GitHub (May 5, 2024):
tcp的我试了是可以的但是这样需要大量端口。如果我单独访问每台机器的ip(http://192.168.1.100)是可以的访问的。我就是想少开端口通过路由来访问。但是没找到方案。您这有什么方式么
@vikii0210 commented on GitHub (May 6, 2024):
frpc+nginx hahaha