[GH-ISSUE #1773] 如何配置 和frpc不在同一台机子的 内网web转发 #1402

Closed
opened 2026-05-05 12:53:18 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @dulm on GitHub (Apr 21, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1773

[web]
type = http
local_port = 80
custom_domains = www.example.com

我看官方例子没有配置ip的地方, 是否只能支持本机, 有没有只使用frp支持暴露其他机子web服务的方法?

已有解决方案

  1. 开一个内网代理, 通过 frpc tcp暴露. 缺点: 需要配一个代理, 另外整个内网暴露了.
  2. 本机配置一个nginx. 缺点: 还需要配nginx比较麻烦.
Originally created by @dulm on GitHub (Apr 21, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1773 ``` [web] type = http local_port = 80 custom_domains = www.example.com ``` 我看官方例子没有配置ip的地方, 是否只能支持本机, 有没有只使用frp支持暴露其他机子web服务的方法? 已有解决方案 1. 开一个内网代理, 通过 frpc tcp暴露. 缺点: 需要配一个代理, 另外整个内网暴露了. 2. 本机配置一个nginx. 缺点: 还需要配nginx比较麻烦.
gitea-mirror 2026-05-05 12:53:18 -06:00
Author
Owner

@yingziwu commented on GitHub (Apr 23, 2020):

设置 local_ip 就可以了。
比方说:你的网站域名 example.com,现在运行 frpc 的机器内网IP 192.168.100.1,你现在想把 example.com 请求转发至 192.168.100.114,只需要把 local_ip 设定为转发目的地就可以了。

[web]
type = http
local_ip = 192.168.100.114
local_port = 80
custom_domains = example.com

另外 local_ip 只是转发的目的地,并不局限于内网IP,你将 local_ip 设置为公网IP也是没有问题的。

[web]
privilege_mode = true
type = http
local_ip =  93.184.216.34
local_port = 80
custom_domains = example.com
<!-- gh-comment-id:618305076 --> @yingziwu commented on GitHub (Apr 23, 2020): 设置 `local_ip` 就可以了。 比方说:你的网站域名 `example.com`,现在运行 `frpc` 的机器内网IP `192.168.100.1`,你现在想把 `example.com` 请求转发至 `192.168.100.114`,只需要把 `local_ip` 设定为转发目的地就可以了。 ``` [web] type = http local_ip = 192.168.100.114 local_port = 80 custom_domains = example.com ``` 另外 `local_ip` 只是转发的目的地,并不局限于内网IP,你将 `local_ip` 设置为公网IP也是没有问题的。 ``` [web] privilege_mode = true type = http local_ip = 93.184.216.34 local_port = 80 custom_domains = example.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#1402
No description provided.