[GH-ISSUE #2210] web代理可以使用subdomain,能否增加一个功能使用header区分呢 #1759

Closed
opened 2026-05-05 13:08:08 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @jiangtaomt on GitHub (Jan 22, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2210

在某些情况下没有域名,也不能暴露更多公网端口的情况下,可否通过header,映射到不同的内网web服务。

例如

[web]
type = http
local_port = 80
custom_header = header_key:header_value

frps当收到 web请求中,含有header_key=header_value 时,转到对应的代理

Originally created by @jiangtaomt on GitHub (Jan 22, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2210 在某些情况下没有域名,也不能暴露更多公网端口的情况下,可否通过header,映射到不同的内网web服务。 例如 ``` [web] type = http local_port = 80 custom_header = header_key:header_value ``` frps当收到 web请求中,含有header_key=header_value 时,转到对应的代理
gitea-mirror 2026-05-05 13:08:08 -06:00
  • closed this issue
  • added the
    proposal
    label
Author
Owner

@heybody commented on GitHub (Jan 26, 2021):

这个需求应该可以内网部署个nginx ,在nginx配置header转发;

<!-- gh-comment-id:767528756 --> @heybody commented on GitHub (Jan 26, 2021): 这个需求应该可以内网部署个nginx ,在nginx配置header转发;
Author
Owner

@fatedier commented on GitHub (Jan 26, 2021):

可以考虑,但是目前基于 ini 的配置文件的表达能力比较弱,一些复杂的功能描述没那么简洁,需要仔细考虑一下具体的用法。

<!-- gh-comment-id:767543362 --> @fatedier commented on GitHub (Jan 26, 2021): 可以考虑,但是目前基于 ini 的配置文件的表达能力比较弱,一些复杂的功能描述没那么简洁,需要仔细考虑一下具体的用法。
Author
Owner

@jiangtaomt commented on GitHub (Jan 27, 2021):

我这是为了管理散落在各地的docker主机,场景倒是比较简单,使用unix socket插件 转发/var/run/docker.socket 。之前倒是考虑过stcp,需要在服务器端部署frpc 和frps。

<!-- gh-comment-id:768276065 --> @jiangtaomt commented on GitHub (Jan 27, 2021): 我这是为了管理散落在各地的docker主机,场景倒是比较简单,使用unix socket插件 转发/var/run/docker.socket 。之前倒是考虑过stcp,需要在服务器端部署frpc 和frps。
Author
Owner

@fatedier commented on GitHub (Jan 27, 2021):

@jiangtao1921 其实通过域名做路由也可以的,相当于是基于 host header 做路由。

curl http://{frps IP}/xxx -H 'Host: host1'

类似这样,custom_domains 里填写 host1, host2

<!-- gh-comment-id:768279944 --> @fatedier commented on GitHub (Jan 27, 2021): @jiangtao1921 其实通过域名做路由也可以的,相当于是基于 host header 做路由。 `curl http://{frps IP}/xxx -H 'Host: host1'` 类似这样,custom_domains 里填写 host1, host2
Author
Owner

@frankli0324 commented on GitHub (Jan 31, 2021):

类似这样,custom_domains 里填写 host1, host2

在国内域名备案的环境下不可行

<!-- gh-comment-id:770347426 --> @frankli0324 commented on GitHub (Jan 31, 2021): > 类似这样,custom_domains 里填写 host1, host2 在国内域名备案的环境下不可行
Author
Owner

@jiangtaomt commented on GitHub (Jan 31, 2021):

已解决

<!-- gh-comment-id:770377653 --> @jiangtaomt commented on GitHub (Jan 31, 2021): 已解决
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#1759
No description provided.