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返回错误的页面,访问不同子域名时返回错误页面 #4278

Open
1 of 11 tasks
zackeryyy00 opened this issue Jun 13, 2024 · 1 comment
Open
1 of 11 tasks

Comments

@zackeryyy00
Copy link

Bug Description

标题: 子域名路由问题:访问不同子域名时返回错误页面

描述:
我在使用FRP进行内网穿透时遇到一个问题,当访问不同的子域名时,会返回错误的页面。当我访问一个子域名(例如 https://subdomain1.example.com:3443)时,页面显示正常。但随后访问另一个子域名(例如 https://subdomain2.example.com:3443)时,返回的却是第一个子域名的页面。这个问题在不同的设备和网络环境下都存在。关闭浏览器或使用无痕模式可以暂时解决问题,但在切换子域名后问题又会出现。

预期行为:
每个子域名应该显示其对应的页面,不应被其他子域名干扰。

实际行为:
访问一个子域名后,再访问另一个子域名会返回错误的页面。

附加信息:

  • 这个问题在不同的设备和网络环境下都存在。
  • 清除浏览器缓存和Cookie或使用无痕模式可以暂时解决问题。
  • FRP客户端和服务端日志中没有出现相关的错误信息或警告。

环境:

  • FRP版本: [0.58.1]
  • 操作系统: [客户端:ubuntu22.04],[服务端:尝试过ubuntu22.04和windows11均有此问题]
  • 浏览器: [edge,Firefox,safari]

frpc Version

0.58.1

frps Version

0.58.1

System Architecture

linux/amd64,windows/amd64

Configurations

客户端配置 (frpc.toml):

serverAddr = "xx.xx.xx.xx"
serverPort = 7000

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = xxxx

[[proxies]]
name = "code"
type = "https"
subdomain = "code"

[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:38089"
crtPath = "/etc/letsencrypt/live/example.com/example.com.crt"
keyPath = "/etc/letsencrypt/live/example.com/example.com.key"
hostHeaderRewrite = "code.example.com"
requestHeaders.set.x-from-where = "frp"

[[proxies]]
name = "portainer"
type = "https"
subdomain = "portainer"

[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:9000"
crtPath = "/etc/letsencrypt/live/example.com/example.com.crt"
keyPath = "/etc/letsencrypt/live/example.com/example.com.key"
hostHeaderRewrite = "portainer.example.com"
requestHeaders.set.x-from-where = "frp"

[[proxies]]
name = "lobe"
type = "https"
subdomain = "lobechat"

[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:3210"
crtPath = "/etc/letsencrypt/live/example.com/example.com.crt"
keyPath = "/etc/letsencrypt/live/example.com/example.com.key"
hostHeaderRewrite = "lobechat.example.com"
requestHeaders.set.x-from-where = "frp"

[[proxies]]
name = "newchat"
type = "https"
subdomain = "newchat"

[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:6015"
crtPath = "/etc/letsencrypt/live/example.com/example.com.crt"
keyPath = "/etc/letsencrypt/live/example.com/example.com.key"
hostHeaderRewrite = "newchat.example.com"
requestHeaders.set.x-from-where = "frp"

服务端配置 (frps.toml):

bindPort = 7000
vhostHTTPPort = 8080
vhostHTTPSPort = 3443
subdomainHost = "example.com"

Logs

日志似乎没什么特殊的(使用gpt隐去了域名ip等):

2024-06-13 20:59:22.543 [I] [server/service.go:576] [7775bf3f146c1f82] client login info: ip [xx.xx.xx.xx:xxxxx] version [0.58.1] hostname [] os [linux] arch [amd64]
2024-06-13 20:59:22.571 [I] [proxy/https.go:79] [7775bf3f146c1f82] [lobe] https proxy listen for host [subdomain1.example.com]
2024-06-13 20:59:22.571 [I] [server/control.go:399] [7775bf3f146c1f82] new proxy [lobe] type [https] success
2024-06-13 20:59:22.571 [I] [proxy/https.go:79] [7775bf3f146c1f82] [newchat] https proxy listen for host [subdomain2.example.com]
2024-06-13 20:59:22.571 [I] [server/control.go:399] [7775bf3f146c1f82] new proxy [newchat] type [https] success
2024-06-13 20:59:22.571 [I] [proxy/https.go:79] [7775bf3f146c1f82] [code] https proxy listen for host [subdomain3.example.com]
2024-06-13 20:59:22.571 [I] [server/control.go:399] [7775bf3f146c1f82] new proxy [code] type [https] success
2024-06-13 20:59:22.571 [I] [proxy/http.go:144] [7775bf3f146c1f82] [ollama] http proxy listen for host [subdomain4.example.com] location [] group [], routeByHTTPUser []
2024-06-13 20:59:22.572 [I] [server/control.go:399] [7775bf3f146c1f82] new proxy [ollama] type [http] success
2024-06-13 20:59:22.572 [I] [proxy/https.go:79] [7775bf3f146c1f82] [portainer] https proxy listen for host [subdomain5.example.com]
2024-06-13 20:59:22.572 [I] [server/control.go:399] [7775bf3f146c1f82] new proxy [portainer] type [https] success
2024-06-13 20:59:22.573 [I] [proxy/tcp.go:82] [7775bf3f146c1f82] [ssh] tcp proxy listen port [xxxx]
2024-06-13 20:59:22.573 [I] [server/control.go:399] [7775bf3f146c1f82] new proxy [ssh] type [tcp] success

Steps to reproduce

  1. 在浏览器中访问 https://subdomain1.example.com:3443,页面显示正常。
  2. 不关闭浏览器,访问 https://subdomain2.example.com:3443,页面显示为 https://subdomain1.example.com:3443 的内容。
  3. 关闭浏览器或使用无痕模式。
  4. 再次访问 https://subdomain2.example.com:3443,页面显示正常。
  5. 现在访问 https://subdomain1.example.com:3443,页面显示为 https://subdomain2.example.com:3443 的内容。

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
@xqzr
Copy link

xqzr commented Jun 13, 2024

很早之前也遇到过,当时没有解决
应该是和 TLS Session Ticket 有关 https://cong5.net/post/nginx-ssl-session-tickets-error

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

No branches or pull requests

2 participants