[GH-ISSUE #782] 通过frp穿透内网web服务失败。frp服务端提示:http: proxy error: no such domain, #611

Closed
opened 2026-05-05 12:23:46 -06:00 by gitea-mirror · 22 comments
Owner

Originally created by @AllstarVirgo on GitHub (May 20, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/782

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

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

What operating system and processor architecture are you using (go env)?
服务端:centos 7
客户端: windows 10

Configures you used:

客户端

[common]
server_addr = 139.199.87.90
server_port = 7000
[web]type = http local_port = 8081 custom_domains = http://www.zhengcehuixiang.cn

=================================================================

服务端

bind_port = 7000
vhost_http_port = 8181

Steps to reproduce the issue:
1.在centos 7配置服务端文件frps.ini
2.在win10 配置了客户端的配置文件frpc.ini,开启本地web服务,端口为8081。该服务用Spring Boot开发。
3.frp的服务端和客户端显示连接成功,在本地可以访问web服务。

Describe the results you received:
通过 http://www.zhengcehuixiang.cn:8181/user 访问报错,The page you visit not found.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

The server is powered by frp.

Faithfully yours, frp.

frp服务端提示:
2018/05/20 11:29:42 [W] [newhttp.go:190] http: proxy error: no such domain
2018/05/20 11:29:42 [W] [newhttp.go:190] http: proxy error: no such domain
2018/05/20 11:33:56 [W] [newhttp.go:190] http: proxy error: no such domain
Describe the results you expected:
在web上显示字符串,hello,world。在本地通过localhost:8081/user是可以实现的。

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)
我推测是配置文件没有填对,我是对着frp的官网文档,通过自定义域名访问部署于内网的 web 服务,填写的配置。请各位帮帮忙。衷心感谢。

Originally created by @AllstarVirgo on GitHub (May 20, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/782 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 0.19.0 **What operating system and processor architecture are you using (`go env`)?** 服务端:centos 7 客户端: windows 10 **Configures you used:** # 客户端 [common] server_addr = 139.199.87.90 server_port = 7000 [web]type = http local_port = 8081 custom_domains = http://www.zhengcehuixiang.cn ================================================================= # 服务端 bind_port = 7000 vhost_http_port = 8181 **Steps to reproduce the issue:** 1.在centos 7配置服务端文件frps.ini 2.在win10 配置了客户端的配置文件frpc.ini,开启本地web服务,端口为8081。该服务用Spring Boot开发。 3.frp的服务端和客户端显示连接成功,在本地可以访问web服务。 **Describe the results you received:** 通过 http://www.zhengcehuixiang.cn:8181/user 访问报错,The page you visit not found. Sorry, the page you are looking for is currently unavailable. Please try again later. The server is powered by frp. Faithfully yours, frp. ====================================================== frp服务端提示: 2018/05/20 11:29:42 [W] [newhttp.go:190] http: proxy error: no such domain 2018/05/20 11:29:42 [W] [newhttp.go:190] http: proxy error: no such domain 2018/05/20 11:33:56 [W] [newhttp.go:190] http: proxy error: no such domain **Describe the results you expected:** 在web上显示字符串,hello,world。在本地通过localhost:8081/user是可以实现的。 **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)** 我推测是配置文件没有填对,我是对着frp的官网文档,通过自定义域名访问部署于内网的 web 服务,填写的配置。请各位帮帮忙。衷心感谢。
Author
Owner

@AllstarVirgo commented on GitHub (May 21, 2018):

问题已解决,防火墙没开。

<!-- gh-comment-id:390524990 --> @AllstarVirgo commented on GitHub (May 21, 2018): 问题已解决,防火墙没开。
Author
Owner

@rickycm commented on GitHub (Jun 8, 2018):

我也遇到这个问题,但防火墙确认开了,还有可能是什么原因呢?

<!-- gh-comment-id:395689706 --> @rickycm commented on GitHub (Jun 8, 2018): 我也遇到这个问题,但防火墙确认开了,还有可能是什么原因呢?
Author
Owner

@AllstarVirgo commented on GitHub (Jun 21, 2018):

你按照官网上配制一遍,打开防火墙,应该没问题。win上的配置用notepad++比较好。

<!-- gh-comment-id:399084390 --> @AllstarVirgo commented on GitHub (Jun 21, 2018): 你按照官网上配制一遍,打开防火墙,应该没问题。win上的配置用notepad++比较好。
Author
Owner

@Vickey-Wu commented on GitHub (Jul 13, 2018):

frpc.ini

[common]
server_addr = aliyunserver
server_port = 7000

[web]
type = http
local_port = 80
custom_domains = test.xxx.com

frps.ini

[common]
bind_port = 7000
vhost_http_port = 8000

大家好,我配置了server 和 client运行也成功了,浏览器访问就打不开页面,没有防火墙问题,请问还有什么原因吗?

<!-- gh-comment-id:404763351 --> @Vickey-Wu commented on GitHub (Jul 13, 2018): frpc.ini ``` [common] server_addr = aliyunserver server_port = 7000 [web] type = http local_port = 80 custom_domains = test.xxx.com ``` frps.ini ``` [common] bind_port = 7000 vhost_http_port = 8000 ``` 大家好,我配置了server 和 client运行也成功了,浏览器访问就打不开页面,没有防火墙问题,请问还有什么原因吗?
Author
Owner

@SeanDemo2017 commented on GitHub (Jul 13, 2018):

有没有做端口转发? 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://seandemo2017.wixsite.com/website 签名由 网易邮箱大师 定制 在2018年07月13日 16:23,Vickey Wu 写道: frpc.ini [common]
server_addr = aliyunserver
server_port = 7000

[web]
type = http
local_port = 80
custom_domains = test.xxx.com
frps.ini [common]
bind_port = 7000
vhost_http_port = 8000
大家好,我配置了server 和 client运行也成功了,浏览器访问就打不开页面,没有防火墙问题,请问还有什么原因吗? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:404875341 --> @SeanDemo2017 commented on GitHub (Jul 13, 2018): 有没有做端口转发? 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://seandemo2017.wixsite.com/website 签名由 网易邮箱大师 定制 在2018年07月13日 16:23,Vickey Wu 写道: frpc.ini [common] server_addr = aliyunserver server_port = 7000 [web] type = http local_port = 80 custom_domains = test.xxx.com frps.ini [common] bind_port = 7000 vhost_http_port = 8000 大家好,我配置了server 和 client运行也成功了,浏览器访问就打不开页面,没有防火墙问题,请问还有什么原因吗? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@SeanDemo2017 commented on GitHub (Jul 13, 2018):

比如外网域名到frps机器上,用nginx转发到8080,frps通过8080和frpc通信,frpc机器用80端口 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://seandemo2017.wixsite.com/website 签名由 网易邮箱大师 定制 在2018年07月13日 23:55,肖黎东(守护星) 写道: 有没有做端口转发? 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://seandemo2017.wixsite.com/website 签名由 网易邮箱大师 定制 在2018年07月13日 16:23,Vickey Wu 写道: frpc.ini [common]
server_addr = aliyunserver
server_port = 7000

[web]
type = http
local_port = 80
custom_domains = test.xxx.com
frps.ini [common]
bind_port = 7000
vhost_http_port = 8000
大家好,我配置了server 和 client运行也成功了,浏览器访问就打不开页面,没有防火墙问题,请问还有什么原因吗? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:404875876 --> @SeanDemo2017 commented on GitHub (Jul 13, 2018): 比如外网域名到frps机器上,用nginx转发到8080,frps通过8080和frpc通信,frpc机器用80端口 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://seandemo2017.wixsite.com/website 签名由 网易邮箱大师 定制 在2018年07月13日 23:55,肖黎东(守护星) 写道: 有没有做端口转发? 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://seandemo2017.wixsite.com/website 签名由 网易邮箱大师 定制 在2018年07月13日 16:23,Vickey Wu 写道: frpc.ini [common] server_addr = aliyunserver server_port = 7000 [web] type = http local_port = 80 custom_domains = test.xxx.com frps.ini [common] bind_port = 7000 vhost_http_port = 8000 大家好,我配置了server 和 client运行也成功了,浏览器访问就打不开页面,没有防火墙问题,请问还有什么原因吗? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@Vickey-Wu commented on GitHub (Jul 14, 2018):

你好,你的意思是我要在frps服务器端使用nginx转发frpc的ip:port吗?

<!-- gh-comment-id:405010935 --> @Vickey-Wu commented on GitHub (Jul 14, 2018): 你好,你的意思是我要在frps服务器端使用nginx转发frpc的ip:port吗?
Author
Owner

@SeanDemo2017 commented on GitHub (Jul 14, 2018):

你好,我是这样实现的,frps机器的nginx监听来自域名的80端口(dns服务器转发),直接反向代理到8080端口,接着frps的vhost_http_prot=8080(https同理);监听该端口。

frpc机器(内网)上,通过通信端口(比如我用7000)接受到的指令映射到8080,我再次用nginx监听8080把8080转发到我自己同名的域名空间,这样就可以了。当然frpc机器上你也可以直接使用80默认端口,nginx里vhost改下配置文件就可以,祝你成功

Vickey Wu notifications@github.com 于 2018年7月14日周六 下午5:20写道:

你好,你的意思是我要在frps服务器端使用nginx转发frpc的ip:port吗?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/782#issuecomment-405010935, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AeEQHbR4kKwVyWWhDy2zXunLwokLnwx_ks5uGbffgaJpZM4UF_Vz
.

<!-- gh-comment-id:405015587 --> @SeanDemo2017 commented on GitHub (Jul 14, 2018): 你好,我是这样实现的,frps机器的nginx监听来自域名的80端口(dns服务器转发),直接反向代理到8080端口,接着frps的vhost_http_prot=8080(https同理);监听该端口。 frpc机器(内网)上,通过通信端口(比如我用7000)接受到的指令映射到8080,我再次用nginx监听8080把8080转发到我自己同名的域名空间,这样就可以了。当然frpc机器上你也可以直接使用80默认端口,nginx里vhost改下配置文件就可以,祝你成功 Vickey Wu <notifications@github.com> 于 2018年7月14日周六 下午5:20写道: > 你好,你的意思是我要在frps服务器端使用nginx转发frpc的ip:port吗? > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/fatedier/frp/issues/782#issuecomment-405010935>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AeEQHbR4kKwVyWWhDy2zXunLwokLnwx_ks5uGbffgaJpZM4UF_Vz> > . >
Author
Owner

@Vickey-Wu commented on GitHub (Jul 15, 2018):

你说的“dns服务器转发”,还要先搞个域名吗?不是可以自定义任意的域名吗?

<!-- gh-comment-id:405064566 --> @Vickey-Wu commented on GitHub (Jul 15, 2018): 你说的“dns服务器转发”,还要先搞个域名吗?不是可以自定义任意的域名吗?
Author
Owner

@SeanDemo2017 commented on GitHub (Jul 15, 2018):

你没有域名怎么定向到frps服务器,只能用ip吧 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://www.seanvfx.com 签名由 网易邮箱大师 定制 在2018年07月15日 11:25,Vickey Wu 写道: 你说的“dns服务器转发”,还要先搞个域名吗?不是可以自定义任意的域名吗? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:405064675 --> @SeanDemo2017 commented on GitHub (Jul 15, 2018): 你没有域名怎么定向到frps服务器,只能用ip吧 肖黎东‖Sean 职业:VFX特效师 Email:xiao940213@gmail.com TEL:+86 13066200549 Address:广东省江门市五邑大学 Postal Code:529020 QQ:204606460 Summary:后期特效师 视觉艺术家 https://www.seanvfx.com 签名由 网易邮箱大师 定制 在2018年07月15日 11:25,Vickey Wu 写道: 你说的“dns服务器转发”,还要先搞个域名吗?不是可以自定义任意的域名吗? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@Vickey-Wu commented on GitHub (Jul 15, 2018):

用ip是没问题,就是用自定义域名不行,那还是搞个域名了,谢谢了。

<!-- gh-comment-id:405066144 --> @Vickey-Wu commented on GitHub (Jul 15, 2018): 用ip是没问题,就是用自定义域名不行,那还是搞个域名了,谢谢了。
Author
Owner

@SeanDemo2017 commented on GitHub (Jul 15, 2018):

是的,域名只是指向你那个ip,nginx获取该域名空间

Vickey Wu notifications@github.com 于 2018年7月15日周日 下午12:16写道:

用ip是没问题,就是用自定义域名不行,那还是搞个域名了,谢谢了。


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/782#issuecomment-405066144, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AeEQHQrkbN3PSEDWrVDMAHOoUm2cQfJsks5uGsIOgaJpZM4UF_Vz
.

<!-- gh-comment-id:405066688 --> @SeanDemo2017 commented on GitHub (Jul 15, 2018): 是的,域名只是指向你那个ip,nginx获取该域名空间 Vickey Wu <notifications@github.com> 于 2018年7月15日周日 下午12:16写道: > 用ip是没问题,就是用自定义域名不行,那还是搞个域名了,谢谢了。 > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/fatedier/frp/issues/782#issuecomment-405066144>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AeEQHQrkbN3PSEDWrVDMAHOoUm2cQfJsks5uGsIOgaJpZM4UF_Vz> > . >
Author
Owner

@Thyiad commented on GitHub (Dec 17, 2018):

@Vickey-Wu 请问你解决了吗?我也是用ip可以,用自定义域名不行
同样是frp监听非80端口,nginx配置转发
域名:端口可以访问
子域名无法访问

<!-- gh-comment-id:447803313 --> @Thyiad commented on GitHub (Dec 17, 2018): @Vickey-Wu 请问你解决了吗?我也是用ip可以,用自定义域名不行 同样是frp监听非80端口,nginx配置转发 域名:端口可以访问 子域名无法访问
Author
Owner

@Vickey-Wu commented on GitHub (Dec 18, 2018):

@Thyiad 我后来没用域名,只是用ip

<!-- gh-comment-id:448096278 --> @Vickey-Wu commented on GitHub (Dec 18, 2018): @Thyiad 我后来没用域名,只是用ip
Author
Owner

@Thyiad commented on GitHub (Dec 18, 2018):

@Vickey-Wu 谢谢。
不过我的很奇怪,服务端日志显示已经连接了,但我用域名访问的时候就是会报错
2018/12/18 15:51:33 [I] [proxy.go:291] [d7423b01563af456] [web] http proxy listen for host [test.frp.xxx.com] location [] 2018/12/18 15:51:33 [I] [control.go:335] [d7423b01563af456] new proxy [web] success 2018/12/18 15:51:58 [W] [newhttp.go:209] http: proxy error: no such domain

<!-- gh-comment-id:448130349 --> @Thyiad commented on GitHub (Dec 18, 2018): @Vickey-Wu 谢谢。 不过我的很奇怪,服务端日志显示已经连接了,但我用域名访问的时候就是会报错 ` 2018/12/18 15:51:33 [I] [proxy.go:291] [d7423b01563af456] [web] http proxy listen for host [test.frp.xxx.com] location [] 2018/12/18 15:51:33 [I] [control.go:335] [d7423b01563af456] new proxy [web] success 2018/12/18 15:51:58 [W] [newhttp.go:209] http: proxy error: no such domain `
Author
Owner

@Thyiad commented on GitHub (Dec 18, 2018):

是我对配置理解错误了,因为是配置的转发。所以访问的时候,还是需要加上后缀的端口的,比如我这里配置的是7701,client配置了两个域名,那么分别要这样访问:
test.frp.xx.com:7701
test2.frp.xx.com:7701

<!-- gh-comment-id:448145589 --> @Thyiad commented on GitHub (Dec 18, 2018): 是我对配置理解错误了,因为是配置的转发。所以访问的时候,还是需要加上后缀的端口的,比如我这里配置的是7701,client配置了两个域名,那么分别要这样访问: test.frp.xx.com:7701 test2.frp.xx.com:7701
Author
Owner

@Johnson-LYS commented on GitHub (Aug 15, 2019):

@Vickey-Wu @Thyiad
域名只能通过端口访问的话,nginx可以这样配置
server {
listen 80;
server_name frp.your.com;

location / {
  proxy_pass http://frp.your.com:8080;
}

}

<!-- gh-comment-id:521480437 --> @Johnson-LYS commented on GitHub (Aug 15, 2019): @Vickey-Wu @Thyiad 域名只能通过端口访问的话,nginx可以这样配置 server { listen 80; server_name frp.your.com; location / { proxy_pass http://frp.your.com:8080; } }
Author
Owner

@Johnson-LYS commented on GitHub (Aug 15, 2019):

我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为127.0.0.1:8080。访问http://frp.3to.top出现“The page you request not found”,然后访问http://frp.3to.top:8080可以正常访问。之后修改nginx转发地址为frp.3to.top:8080,可以通过frp.3to.top正常访问。

配置如下:

域名

frp.3to.top

服务端(frps)

[common]
bind_port = 7000
vhost_http_port = 8080

服务端(nginx)

server {
    listen 80;
    server_name  frp.3to.top;

    location / {
      # proxy_pass http://127.0.0.1:8080;
      # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置
      proxy_pass http://frp.3to.top:8080;
    }
}

客户端(frpc)

 [common]
 server_addr = 182.254.232.213                                               
 server_port = 7000
 
 [web]
 type = http
 local_port = 10086
 custom_domains = frp.3to.top
<!-- gh-comment-id:521483106 --> @Johnson-LYS commented on GitHub (Aug 15, 2019): 我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为`127.0.0.1:8080`。访问`http://frp.3to.top`出现“The page you request not found”,然后访问`http://frp.3to.top:8080`可以正常访问。之后修改nginx转发地址为`frp.3to.top:8080`,可以通过`frp.3to.top`正常访问。 配置如下: ### 域名 `frp.3to.top` ### 服务端(frps) ``` [common] bind_port = 7000 vhost_http_port = 8080 ``` ### 服务端(nginx) ``` server { listen 80; server_name frp.3to.top; location / { # proxy_pass http://127.0.0.1:8080; # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置 proxy_pass http://frp.3to.top:8080; } } ``` ### 客户端(frpc) ``` [common] server_addr = 182.254.232.213 server_port = 7000 [web] type = http local_port = 10086 custom_domains = frp.3to.top ```
Author
Owner

@Samge0 commented on GitHub (Sep 5, 2019):

我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为127.0.0.1:8080。访问http://frp.3to.top出现“The page you request not found”,然后访问http://frp.3to.top:8080可以正常访问。之后修改nginx转发地址为frp.3to.top:8080,可以通过frp.3to.top正常访问。

配置如下:

域名

frp.3to.top

服务端(frps)

[common]
bind_port = 7000
vhost_http_port = 8080

服务端(nginx)

server {
    listen 80;
    server_name  frp.3to.top;

    location / {
      # proxy_pass http://127.0.0.1:8080;
      # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置
      proxy_pass http://frp.3to.top:8080;
    }
}

客户端(frpc)

 [common]
 server_addr = 182.254.232.213                                               
 server_port = 7000
 
 [web]
 type = http
 local_port = 10086
 custom_domains = frp.3to.top

赞一个,参考你这个答案,成功访问了本地flask项目,感谢~

<!-- gh-comment-id:528257449 --> @Samge0 commented on GitHub (Sep 5, 2019): > 我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为`127.0.0.1:8080`。访问`http://frp.3to.top`出现“The page you request not found”,然后访问`http://frp.3to.top:8080`可以正常访问。之后修改nginx转发地址为`frp.3to.top:8080`,可以通过`frp.3to.top`正常访问。 > > 配置如下: > > ### 域名 > `frp.3to.top` > > ### 服务端(frps) > ``` > [common] > bind_port = 7000 > vhost_http_port = 8080 > ``` > > ### 服务端(nginx) > ``` > server { > listen 80; > server_name frp.3to.top; > > location / { > # proxy_pass http://127.0.0.1:8080; > # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置 > proxy_pass http://frp.3to.top:8080; > } > } > ``` > > ### 客户端(frpc) > ``` > [common] > server_addr = 182.254.232.213 > server_port = 7000 > > [web] > type = http > local_port = 10086 > custom_domains = frp.3to.top > ``` 赞一个,参考你这个答案,成功访问了本地flask项目,感谢~
Author
Owner

@NJCCJohnWatson commented on GitHub (Jan 23, 2020):

我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为127.0.0.1:8080。访问http://frp.3to.top出现“The page you request not found”,然后访问http://frp.3to.top:8080可以正常访问。之后修改nginx转发地址为frp.3to.top:8080,可以通过frp.3to.top正常访问。

配置如下:

域名

frp.3to.top

服务端(frps)

[common]
bind_port = 7000
vhost_http_port = 8080

服务端(nginx)

server {
    listen 80;
    server_name  frp.3to.top;

    location / {
      # proxy_pass http://127.0.0.1:8080;
      # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置
      proxy_pass http://frp.3to.top:8080;
    }
}

客户端(frpc)

 [common]
 server_addr = 182.254.232.213                                               
 server_port = 7000
 
 [web]
 type = http
 local_port = 10086
 custom_domains = frp.3to.top

非常感谢,原来是需要在NGINX中配置PASS掉 需要穿透的域名。

<!-- gh-comment-id:577754042 --> @NJCCJohnWatson commented on GitHub (Jan 23, 2020): > > > 我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为`127.0.0.1:8080`。访问`http://frp.3to.top`出现“The page you request not found”,然后访问`http://frp.3to.top:8080`可以正常访问。之后修改nginx转发地址为`frp.3to.top:8080`,可以通过`frp.3to.top`正常访问。 > > 配置如下: > ### 域名 > > `frp.3to.top` > ### 服务端(frps) > > ``` > [common] > bind_port = 7000 > vhost_http_port = 8080 > ``` > > ### 服务端(nginx) > > ``` > server { > listen 80; > server_name frp.3to.top; > > location / { > # proxy_pass http://127.0.0.1:8080; > # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置 > proxy_pass http://frp.3to.top:8080; > } > } > ``` > > ### 客户端(frpc) > > ``` > [common] > server_addr = 182.254.232.213 > server_port = 7000 > > [web] > type = http > local_port = 10086 > custom_domains = frp.3to.top > ``` 非常感谢,原来是需要在NGINX中配置PASS掉 需要穿透的域名。
Author
Owner

@turingzz commented on GitHub (Mar 17, 2020):

我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为127.0.0.1:8080。访问http://frp.3to.top出现“The page you request not found”,然后访问http://frp.3to.top:8080可以正常访问。之后修改nginx转发地址为frp.3to.top:8080,可以通过frp.3to.top正常访问。

配置如下:

域名

frp.3to.top

服务端(frps)

[common]
bind_port = 7000
vhost_http_port = 8080

服务端(nginx)

server {
    listen 80;
    server_name  frp.3to.top;

    location / {
      # proxy_pass http://127.0.0.1:8080;
      # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置
      proxy_pass http://frp.3to.top:8080;
    }
}

客户端(frpc)

 [common]
 server_addr = 182.254.232.213                                               
 server_port = 7000
 
 [web]
 type = http
 local_port = 10086
 custom_domains = frp.3to.top

既然用了Nginx代理,就可以不开放vhost_http_port这个端口了。frps填了这个属性启动后(假设vhost_http_port=8080),可以不用多开一个端口,在代理里面设置一下,就能直接代理到本地的localhost:8080。一定要加下面的配置setHeader

server {
    listen         80;
    server_name    frp.3to.top;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;
    }
}
<!-- gh-comment-id:599900902 --> @turingzz commented on GitHub (Mar 17, 2020): > 我使用frp监听8080端口,映射到内网的10086端口,服务器端通过nginx将80端口转发到8080端口,刚开始nginx转发地址配置为`127.0.0.1:8080`。访问`http://frp.3to.top`出现“The page you request not found”,然后访问`http://frp.3to.top:8080`可以正常访问。之后修改nginx转发地址为`frp.3to.top:8080`,可以通过`frp.3to.top`正常访问。 > > 配置如下: > > ### 域名 > `frp.3to.top` > > ### 服务端(frps) > ``` > [common] > bind_port = 7000 > vhost_http_port = 8080 > ``` > > ### 服务端(nginx) > ``` > server { > listen 80; > server_name frp.3to.top; > > location / { > # proxy_pass http://127.0.0.1:8080; > # 代理到127.0.0.1:8080可以通过frp.3to.top:8080,但是frp.3to.top还是访问不到,所以改为下面配置 > proxy_pass http://frp.3to.top:8080; > } > } > ``` > > ### 客户端(frpc) > ``` > [common] > server_addr = 182.254.232.213 > server_port = 7000 > > [web] > type = http > local_port = 10086 > custom_domains = frp.3to.top > ``` 既然用了Nginx代理,就可以不开放vhost_http_port这个端口了。frps填了这个属性启动后(假设vhost_http_port=8080),可以不用多开一个端口,在代理里面设置一下,就能直接代理到本地的localhost:8080。一定要加下面的配置setHeader ``` server { listen 80; server_name frp.3to.top; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; } } ```
Author
Owner

@wanglongbiao commented on GitHub (Mar 29, 2020):

没以前好配置了

<!-- gh-comment-id:605631577 --> @wanglongbiao commented on GitHub (Mar 29, 2020): 没以前好配置了
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#611
No description provided.