Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【frp-0.14.1】两个子域名和两个服务不能一对一的正确访问 #628

Closed
Jonkimi opened this issue Jan 29, 2018 · 7 comments
Closed

Comments

@Jonkimi
Copy link

Jonkimi commented Jan 29, 2018

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)?
frps 和frpc的版本都是0.14.1

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build719236514=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2

Configures you used:

在云服务器上部署frps和blog服务,在内网机器上部署gitlab服务。
实现最后能使用两个子域名分别访问两个服务。

frps配置

[common]
bind_port = 7000
vhost_https_port = 443
privilege_mode = true
privilege_token = password
privilege_allow_ports = 7000-8000
subdomain_host = example.com
log_level = trace

frpc配置1--blog服务

[common]
server_addr = *.*.*.*
server_port = 7000
privilege_token = password

[web_blog]
type = https
local_ip = 127.0.0.1
local_port = 8443
subdomain = blog

frpc配置2--gitlab服务

[common]
server_addr = *.*.*.*
server_port = 7000
privilege_token = password

[web]
type = https
local_port = 443 
subdomain = gitlab

[ssh]
type = tcp 
local_ip = 127.0.0.1
local_port = 22
remote_port = 8001

nginx配置

server {
        listen       8443 ssl http2;
        server_name  blog.example.com;
        ssl          on;
        root   /usr/share/nginx/html;
        index index.html;
}

Steps to reproduce the issue:

  1. frps服务和frpc配置1的blog部署在阿里云机器上,frpc配置2的gitlab部署在内网机器上;
  2. 启动blog服务,不启动gitlab服务,启动frps和两个frpc;
  3. 浏览器中访问gitlab.example.com。

Describe the results you received:
访问gitlab.example.com实际上访问的是blog服务。

Describe the results you expected:
github.example.com应该无法访问。
Additional information you deem important (e.g. issue happens only occasionally):

  1. 当blog不启动,gitlab启动时,gitlab.example.com访问gitlab服务,blog.example.com不能正常访问,正常;
  2. 当两个服务都启动时,如果blog服务先启动,gitlab.example.com访问blog服务,如果gitlab服务先启动,两个域名都能正常访问。

Can you point out what caused this issue (optional)

@Jonkimi Jonkimi changed the title 两个子域名和两个服务不能一对一的正确访问 【frp-0.14.1】两个子域名和两个服务不能一对一的正确访问 Jan 29, 2018
@fatedier
Copy link
Owner

本地无法复现,建议更新到最新版本再测试下吧。

@Jonkimi
Copy link
Author

Jonkimi commented Feb 27, 2018

更新到最新版本重新测试后发现是谷歌浏览器的问题。IE上测试访问均正常,火狐Ctrl+F5强制刷新后域名可正常对应服务,谷歌浏览器基本没戏。

@Jonkimi Jonkimi closed this as completed Feb 27, 2018
@notedit
Copy link

notedit commented Mar 19, 2018

我也遇到类似的问题 多个子域名访问对不上 访问 a.xxx.net 有时候会出现 b.xxx.net 的内容

@Jonkimi
Copy link
Author

Jonkimi commented Mar 14, 2019

@fatedier 我的网站都是使用的 HTTP2,而 HTTP2 有多路复用,通过抓包,相同IP不同域名浏览器使用了同一个 TCP 连接,应该是 frp 不支持 HTTP2。(frp-0.25.0 目前测试结果一样)

@Jonkimi Jonkimi reopened this Mar 14, 2019
@Jonkimi
Copy link
Author

Jonkimi commented Mar 14, 2019

发现和 #913 问题相同

@Jonkimi Jonkimi closed this as completed Mar 14, 2019
@Jonkimi Jonkimi reopened this Mar 15, 2019
@Jonkimi
Copy link
Author

Jonkimi commented Mar 15, 2019

查阅到的连接复用相关资料 Connection ReuseHow Connection Reuse works on multiple browsers

我的网站使用的是同一个通配域名证书,都配置了 HTTP2,符合 rfc7540 里所说的 reuse 情况。

找到的解决方法: if you do not want connection sharing to happen, have a different IP address and/or ensure no overlaps in certificates, 我把通配域名证书改成单域名证书问题解决,非 frp 的问题。

@fatedier fatedier closed this as completed Jun 4, 2019
@ax2009live
Copy link

ax2009live commented May 18, 2021

查阅到的连接复用相关资料 Connection ResuseHow Connection Resuse works on multiple browsers

我的网站使用的是同一个通配域名证书,都配置了 HTTP2,符合 rfc7540 里所说的 reuse 情况。

找到的解决方法: if you do not want connection sharing to happen, have a different IP address and/or ensure no overlaps in certificates, 我把通配域名证书改成单域名证书问题解决,非 frp 的问题。

果然,按照您说的,把通配域名证书改成单域名证书,问题就解决了,解决困扰了我很久的问题,非常感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants