mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #365] 同一客户端能否转发多个端口 #265
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#265
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 @liwenjie119 on GitHub (Jun 15, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/365
通过自定义域名访问部署于内网的 web 服务,由于有多个网站不在同一端口,如80和82,请问如何转发?是在vhost_http_port填写两个端口吗
@ChicBrother commented on GitHub (Jun 15, 2017):
多个域名嘛。
@wxlg1117 commented on GitHub (Jun 15, 2017):
上域名管理网站配置好 *.frp转发到frps服务器ip
多个子域名好用 👍
frps.ini里面配置上vhost_http_porty = 50080 (一个端口)
subdomain_host = frp.xxx.com
以及配置好privilege_token = 123456
然后frpc.ini里面配置web服务的时候:
几个主要配置必须写
privilege_token = 123456 特权模式连接frps
[web1] []内随意填写,会出现在log内,多个不能重复
type = http
local_ip = 127.0.0.1
local_port = 80
subdomain = front 这里写要配置的三级域名前缀
#custom_domains = frp.com 注意,这个选项必须注释掉
[web2] []内随意填写,会出现在log内,多个不能重复
type = http
local_ip = 127.0.0.1
local_port = 81
subdomain = back 这里写要配置的三级域名前缀
#custom_domains = frp.com 注意,这个选项必须注释掉
如果转发的http服务在多个机器,依样修改对应的local_port和subdomain
然后即可用http:/front .frp.xxx.com:50080/ 访问web1
http:/back.frp.xxx.com:50080/ 访问web2
@liwenjie119 commented on GitHub (Jun 15, 2017):
按照你此方法出现以下问题
new proxy [web1] error: type [http] not support when vhost_http_port is not set
@liwenjie119 commented on GitHub (Jun 15, 2017):
[service.go:172] Accept new mux stream error: broken pipe
@wxlg1117 commented on GitHub (Jun 15, 2017):
type [http] not support when vhost_http_port is not set
很明显啊,你的frps.ini里面没设置vhost_http_port...
@liwenjie119 commented on GitHub (Jun 18, 2017):
有个问题,我在老毛子路由器固件里这样设置
[common]
server_addr = my VPS IP
server_port = 7000
privilege_token = 123456
[web1]
privilege_mode = true
remote_port = 6000
type = http
local_ip = 192.168.31.1
local_port = 80
use_gzip = true
subdomain = web
#host_header_rewrite =
log_file = /dev/null
log_level = info
log_max_days = 3
[web2]
privilege_mode = true
remote_port = 6000
type = http
local_ip = my VPS IP
local_port = 82
use_gzip = true
subdomain = pan
#host_header_rewrite =
log_file = /dev/null
log_level = info
log_max_days = 3
服务端
[common]
vhost_http_porty = 7000
dashboard_port = 7500
vhost_http_port = 80
subdomain_host =frp.xxxx.cn
privilege_mode = true
privilege_token = 123456
max_pool_count = 50
log_file = ./frps1.log
log_level = info
log_max_days = 3
就在http://frp.xxxx.cn:7500/看到两个80端口,但 SubDomain一个是 pan.frp.xxxx.cn,另一个是 web.frp.xxxx.cn,然后就可以用web.frp.xxxx.cn直接访问,而pan.frp.xxxx.cn无法访问。
若在服务端设置加一句vhost_http_port = 82,就变成两个82端口了,请问怎么解决
@wyyl1 commented on GitHub (May 11, 2020):
好用,非常感谢
@tropicaljungle commented on GitHub (Feb 19, 2024):
这个思路优秀,回头试试看