[GH-ISSUE #204] 在特权模式下多个vhost端口如何配置 #138

Closed
opened 2026-05-05 11:50:15 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @idoall on GitHub (Dec 28, 2016).
Original GitHub issue: https://github.com/fatedier/frp/issues/204

在frps,中如果设置多个vhost_http_port的话,只有最后一个起作用
而在frpc使用特权模式,有多个站点时,无法分配不同的端口号。

比如,期望在一个frpc中,即可配置a.xx.com:80访问,又可以配置a.xx.com:5000访问到另外一个地址

Originally created by @idoall on GitHub (Dec 28, 2016). Original GitHub issue: https://github.com/fatedier/frp/issues/204 在frps,中如果设置多个vhost_http_port的话,只有最后一个起作用 而在frpc使用特权模式,有多个站点时,无法分配不同的端口号。 比如,期望在一个frpc中,即可配置a.xx.com:80访问,又可以配置a.xx.com:5000访问到另外一个地址
Author
Owner

@fatedier commented on GitHub (Dec 28, 2016):

vhost 的作用就是使不同的域名可以共用同一个 80 端口对外提供服务,会根据域名路由到后端不同的服务。

你的这个需求可以使用 tcp 类型,不需要使用 vhost。

<!-- gh-comment-id:269490290 --> @fatedier commented on GitHub (Dec 28, 2016): vhost 的作用就是使不同的域名可以共用同一个 80 端口对外提供服务,会根据域名路由到后端不同的服务。 你的这个需求可以使用 tcp 类型,不需要使用 vhost。
Author
Owner

@idoall commented on GitHub (Dec 29, 2016):

使用tcp的话,整个frpc都出问题了,请帮忙看下我的配置是否有问题

[web01]
privilege_mode = true
type = tcp
local_ip = 172.17.0.10
local_port = 5000
use_encryption = true
use_gzip = true
custom_domains = a.xx.com

下面是frpc的日志错误信息

2016/12/29 07:09:32 [client.go:42] [E] ProxyName [a.xx.com], connect to local port error, dial tcp 172.17.0.10:5000: getsockopt: no route to host
2016/12/29 07:10:11 [client.go:42] [E] ProxyName [a.xx.com], connect to local port error, dial tcp 172.17.0.10:5000: getsockopt: no route to host
<!-- gh-comment-id:269576905 --> @idoall commented on GitHub (Dec 29, 2016): 使用tcp的话,整个frpc都出问题了,请帮忙看下我的配置是否有问题 ```ini [web01] privilege_mode = true type = tcp local_ip = 172.17.0.10 local_port = 5000 use_encryption = true use_gzip = true custom_domains = a.xx.com ``` 下面是frpc的日志错误信息 ```shell 2016/12/29 07:09:32 [client.go:42] [E] ProxyName [a.xx.com], connect to local port error, dial tcp 172.17.0.10:5000: getsockopt: no route to host 2016/12/29 07:10:11 [client.go:42] [E] ProxyName [a.xx.com], connect to local port error, dial tcp 172.17.0.10:5000: getsockopt: no route to host ```
Author
Owner

@fatedier commented on GitHub (Dec 29, 2016):

frpc 所在服务器无法连接到 172.17.0.10,另外 tcp 类型不用配 custom_domains。

<!-- gh-comment-id:269577222 --> @fatedier commented on GitHub (Dec 29, 2016): frpc 所在服务器无法连接到 172.17.0.10,另外 tcp 类型不用配 custom_domains。
Author
Owner

@idoall commented on GitHub (Jan 5, 2017):

如果不配置TCP是http的话是可以连接的,看来TCP是不起作用

<!-- gh-comment-id:270679396 --> @idoall commented on GitHub (Jan 5, 2017): 如果不配置TCP是http的话是可以连接的,看来TCP是不起作用
Author
Owner

@fatedier commented on GitHub (Jan 5, 2017):

你配置中是 web01,日志里是 a.xx.com,这个配置是否有问题?

建议先使用文档里介绍的最简单的配置,成功了之后再增加其他配置。

<!-- gh-comment-id:270691575 --> @fatedier commented on GitHub (Jan 5, 2017): 你配置中是 web01,日志里是 a.xx.com,这个配置是否有问题? 建议先使用文档里介绍的最简单的配置,成功了之后再增加其他配置。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#138
No description provided.