mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3120] frp监听端口创建成功无法访问http #2500
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#2500
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 @nobiusmallyu on GitHub (Oct 7, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3120
Bug Description
使用 域名访问的时候无法访问到,访问格式:域名:端口
使用IP访问的时候可以访问到 但是提示错误,错误如下:
[I] [root.go:209] frps uses config file: frps.ini
2022/10/07 10:19:01 [I] [service.go:194] frps tcp listen on 0.0.0.0:7777
2022/10/07 10:19:01 [I] [service.go:237] http service listen on 0.0.0.0:3000
2022/10/07 10:19:01 [I] [root.go:218] frps started successfully
2022/10/07 10:19:05 [W] [http.go:115] do http proxy request [host:xxxxx:3000] error: no route found: xxxxx /
2022/10/07 10:19:05 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /favicon.ico
2022/10/07 10:19:07 [I] [service.go:450] [975ff035dd9da109] client login info: ip [xxxxxxx:31676] version [0.43.0] hostname [] os [windows] arch [amd64]
2022/10/07 10:19:07 [I] [tcp.go:64] [975ff035dd9da109] [HTTP] tcp proxy listen port [0]
2022/10/07 10:19:07 [I] [control.go:465] [975ff035dd9da109] new proxy [HTTP] type [tcp] success
2022/10/07 10:19:11 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxxx /
2022/10/07 10:19:15 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /index.html
2022/10/07 10:20:45 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /index.html
2022/10/07 10:20:47 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /index.html
2022/10/07 10:20:48 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /index.html
2022/10/07 10:20:54 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /index.html
2022/10/07 10:20:59 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /index.html
2022/10/07 10:21:05 [W] [http.go:115] do http proxy request [host: xxxxx:3000] error: no route found: xxxxx /
当然我在这台机器上已经运行过一次了,运行端口是8080 使用的是不一样的配置,端口也不一样。8080这次应用则是没有问题的。
frpc Version
0.44.0
frps Version
0.44.0
System Architecture
linux/amd64
Configurations
服务端:
[common]
bind_port = 7777
vhost_http_port=8081
token=xuanzi123
客户端:
[common]
server_addr= ip 这里是我外网的IP
server_port= 7777 这里是端口
token= xxx
[http]
type=http
local_ip=127.0.0.1
local_port=3000 这个是我本地应用所在端口
custom_domains= xxx
服务端是linux
客户端是windows 2012
Logs
No response
Steps to reproduce
...
Affected area
@Becods commented on GitHub (Oct 7, 2022):
截图,谢谢
信息里的xxxxx换成看起来像是域名的格式,配置文件多域名用半角逗号分隔
另外,信息要属实
@nobiusmallyu commented on GitHub (Oct 19, 2022):
我在内网是多台机器,如何分配?是每台机器都使用同样的配置?
[common]
server_addr = 140.150.120.130 (hide)
server_port = 7000
log_level = trace
[web]
type = http
local_port = 8000
custom_domains = frp.mydomin.com (hide)
还是有什么需要改动?如机器1是以上配置,机器2只需要修改域名就好还是?
@hi-adieu commented on GitHub (Nov 17, 2022):
请问最后是怎么解决的呢?我和你情况一样/(ㄒoㄒ)/~~
@github-actions[bot] commented on GitHub (Dec 18, 2022):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
@llwq123456 commented on GitHub (Feb 25, 2023):
解决了吗?
@Trace-star commented on GitHub (Mar 23, 2023):
这个问题解决了吗,我也遇到这个问题了
@412702 commented on GitHub (Jun 12, 2023):
找到两个解决方案,第一,如果使用type=http 则必须在访问的时候使访问协议、域名、端口保持一致,比如服务端有vhost_http_port = 7777, 客户端有costum_domains=test.example.com , 则访问的时候需要 http://test.example.com:7777 。
这里要注意浏览器有可能自动重定向到https,导致访问不到对应目标。对于如果配置了https则是同理,不过需要按照文档去配置证书。建议子域名直接监听在80和443端口,那样就可以域名访问,而不是域名加端口这样的操作。
第二个,假装使用tcp来假装绕过http。设置type为tcp,那样就不用配置costum_domains,只需要额外配置一个remote_port,如果像使用域名访问自己在nginx里面配置一个端口代理就行了,简单有效。【有一个坑在nginx做请求转发的时候会报错,难定】
@moxiegushi commented on GitHub (Jul 6, 2023):
方法二生效了,感谢大神! @412702 。不过还有一个小问题想请教一下,现在frps的机器上通过nginx把443的请求转发到remote_port,然后再转发到frpc机器的内网https服务,这个可以走通了,可以直接通过域名访问。 但是当我想把443端口改成其他自定义端口(修改了nginx.conf中监听的443端口为8899),通过域名:8899 这种形式去请求,就会超时。
@zpyuan6 commented on GitHub (Feb 21, 2024):
方法一同样有效,感谢感谢。