[GH-ISSUE #1742] frp如何设置可以实现公网访问内网博客? #1377

Closed
opened 2026-05-05 12:52:21 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @bruceluo111 on GitHub (Apr 10, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1742

What version of frp are you using (./frpc -v or ./frps -v)?
0.29.1

What operating system and processor architecture are you using (go env)?
Raspbian

Configures you used:
我之前用frp和国外VPS做内网穿透树莓派可以SSH访问,aria2远程下载,然后最近搭了个wordpress博客想让外网访问,然后就只改了以下设置,其他没改:
【web01】
type = http
local_ip=127.0.0.1
local_port=8080 (我的wordpress本地网页端口用的8080,害怕别的程序要用80起冲突)
use_encryption=true
use_compression=false

Steps to reproduce the issue:
1.远程登录SSH,sudo nano /etc/frpc/frpc_full.ini
2.改完后我ctrl+x退出,Y保存,回车返回
3.输入systemctl restart frpc
4.远程连接直接断了,再连也连不上,说明frpc没有启动
5.因为我把frpc做成了service,所以又在本地局域网接着用了systemctl daemon-reload, systemctl start frpc,都启动不了
6.然后sudo nano /etc/frpc/frpc_full.ini, 又把刚做的更改全部注释掉,再systemctl daemon-reload, 然后status是activated, 然后systemctl enable frpc, 就恢复正常了可以开机自启和远程连接

Describe the results you received:*
远程SSH直接断开,frpc应该是没启动

Describe the results you expected:
本来想着改完【web01】就可以输入VPS的IP加本地端口8080就可以公网访问本地博客

Additional information you deem important (e.g. issue happens only occasionally):
是不是不是改【web01】,而是改【Rang:udp_port】? 我是小白,只是看网上教程搞得tcp穿透,博客搭建,不想搞路由器端口转发, 非常感谢大神解答:我该改哪里的设置,是输入VPS的IP和【range:udp_port】里随便设置的远程端口还是什么IP加什么端口远程访问本地博客?

Can you point out what caused this issue (optional)

Originally created by @bruceluo111 on GitHub (Apr 10, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1742 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.29.1 **What operating system and processor architecture are you using (`go env`)?** Raspbian **Configures you used:** 我之前用frp和国外VPS做内网穿透树莓派可以SSH访问,aria2远程下载,然后最近搭了个wordpress博客想让外网访问,然后就只改了以下设置,其他没改: 【web01】 type = http local_ip=127.0.0.1 local_port=8080 (我的wordpress本地网页端口用的8080,害怕别的程序要用80起冲突) use_encryption=true use_compression=false **Steps to reproduce the issue:** 1.远程登录SSH,sudo nano /etc/frpc/frpc_full.ini 2.改完后我ctrl+x退出,Y保存,回车返回 3.输入systemctl restart frpc 4.远程连接直接断了,再连也连不上,说明frpc没有启动 5.因为我把frpc做成了service,所以又在本地局域网接着用了systemctl daemon-reload, systemctl start frpc,都启动不了 6.然后sudo nano /etc/frpc/frpc_full.ini, 又把刚做的更改全部注释掉,再systemctl daemon-reload, 然后status是activated, 然后systemctl enable frpc, 就恢复正常了可以开机自启和远程连接 *Describe the results you received:** 远程SSH直接断开,frpc应该是没启动 **Describe the results you expected:** 本来想着改完【web01】就可以输入VPS的IP加本地端口8080就可以公网访问本地博客 **Additional information you deem important (e.g. issue happens only occasionally):** 是不是不是改【web01】,而是改【Rang:udp_port】? 我是小白,只是看网上教程搞得tcp穿透,博客搭建,不想搞路由器端口转发, 非常感谢大神解答:我该改哪里的设置,是输入VPS的IP和【range:udp_port】里随便设置的远程端口还是什么IP加什么端口远程访问本地博客? **Can you point out what caused this issue (optional)**
gitea-mirror 2026-05-05 12:52:21 -06:00
Author
Owner

@fatedier commented on GitHub (Apr 10, 2020):

建议直接参考文档 通过 ssh 访问公司内网机器配置一个 TCP 的映射

<!-- gh-comment-id:611867023 --> @fatedier commented on GitHub (Apr 10, 2020): 建议直接参考文档 [通过 ssh 访问公司内网机器](https://github.com/fatedier/frp/blob/master/README_zh.md#%E9%80%9A%E8%BF%87-ssh-%E8%AE%BF%E9%97%AE%E5%85%AC%E5%8F%B8%E5%86%85%E7%BD%91%E6%9C%BA%E5%99%A8)配置一个 TCP 的映射
Author
Owner

@bruceluo111 commented on GitHub (Apr 10, 2020):

建议直接参考文档 通过 ssh 访问公司内网机器配置一个 TCP 的映射

我已经有两个TCP映射了,一个SSH,一个aria2, 现在是想用http, 是要有域名才行吗?还是直接udp设置本地端口和远程端口就可以用VPS的IP和远程端口访问,不需要域名了?

<!-- gh-comment-id:611867654 --> @bruceluo111 commented on GitHub (Apr 10, 2020): > 建议直接参考文档 [通过 ssh 访问公司内网机器](https://github.com/fatedier/frp/blob/master/README_zh.md#%E9%80%9A%E8%BF%87-ssh-%E8%AE%BF%E9%97%AE%E5%85%AC%E5%8F%B8%E5%86%85%E7%BD%91%E6%9C%BA%E5%99%A8)配置一个 TCP 的映射 我已经有两个TCP映射了,一个SSH,一个aria2, 现在是想用http, 是要有域名才行吗?还是直接udp设置本地端口和远程端口就可以用VPS的IP和远程端口访问,不需要域名了?
Author
Owner

@bruceluo111 commented on GitHub (Apr 10, 2020):

建议直接参考文档 通过 ssh 访问公司内网机器配置一个 TCP 的映射
https://github.com/fatedier/frp/blob/master/README_zh.md#%E9%80%9A%E8%BF%87%E8%87%AA%E5%AE%9A%E4%B9%89%E5%9F%9F%E5%90%8D%E8%AE%BF%E9%97%AE%E9%83%A8%E7%BD%B2%E4%BA%8E%E5%86%85%E7%BD%91%E7%9A%84-web-%E6%9C%8D%E5%8A%A1
我看了这个‘通过自定义域名访问部署于内网的 web 服务’,有一些疑问:
[common]
bind_port = 7000
vhost_http_port = 8080
如果port 改成 8080,那之前建的SSH和tcp映射还能用吗?

<!-- gh-comment-id:611871931 --> @bruceluo111 commented on GitHub (Apr 10, 2020): > 建议直接参考文档 [通过 ssh 访问公司内网机器](https://github.com/fatedier/frp/blob/master/README_zh.md#%E9%80%9A%E8%BF%87-ssh-%E8%AE%BF%E9%97%AE%E5%85%AC%E5%8F%B8%E5%86%85%E7%BD%91%E6%9C%BA%E5%99%A8)配置一个 TCP 的映射 https://github.com/fatedier/frp/blob/master/README_zh.md#%E9%80%9A%E8%BF%87%E8%87%AA%E5%AE%9A%E4%B9%89%E5%9F%9F%E5%90%8D%E8%AE%BF%E9%97%AE%E9%83%A8%E7%BD%B2%E4%BA%8E%E5%86%85%E7%BD%91%E7%9A%84-web-%E6%9C%8D%E5%8A%A1 我看了这个‘通过自定义域名访问部署于内网的 web 服务’,有一些疑问: [common] bind_port = 7000 vhost_http_port = 8080 如果port 改成 8080,那之前建的SSH和tcp映射还能用吗?
Author
Owner

@AntiverX commented on GitHub (Apr 11, 2020):

建议直接参考文档 通过 ssh 访问公司内网机器配置一个 TCP 的映射

我已经有两个TCP映射了,一个SSH,一个aria2, 现在是想用http, 是要有域名才行吗?还是直接udp设置本地端口和远程端口就可以用VPS的IP和远程端口访问,不需要域名了?

要不要域名都可以,方法跟映射SSH一样

<!-- gh-comment-id:612378736 --> @AntiverX commented on GitHub (Apr 11, 2020): > > 建议直接参考文档 [通过 ssh 访问公司内网机器](https://github.com/fatedier/frp/blob/master/README_zh.md#%E9%80%9A%E8%BF%87-ssh-%E8%AE%BF%E9%97%AE%E5%85%AC%E5%8F%B8%E5%86%85%E7%BD%91%E6%9C%BA%E5%99%A8)配置一个 TCP 的映射 > > 我已经有两个TCP映射了,一个SSH,一个aria2, 现在是想用http, 是要有域名才行吗?还是直接udp设置本地端口和远程端口就可以用VPS的IP和远程端口访问,不需要域名了? 要不要域名都可以,方法跟映射SSH一样
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#1377
No description provided.