[GH-ISSUE #533] url 路由在复用 http 连接时失败 #413

Closed
opened 2026-05-05 12:13:58 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @sunnyyoung on GitHub (Nov 22, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/533

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

0.13.0

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

Server:

Linux ubuntu 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Configures you used:

Server:

[common]
max_pool_count = 32
bind_port = {{server port}}
vhost_http_port = 80
vhost_https_port = 443
privilege_token = {{token}}
dashboard_port = {{port}}
dashboard_user = {{username}}
dashboard_pwd = {{password}}

Client:

[common]
log_file = /dev/null
log_level = error
log_max_days = 1
login_fail_exit = false
protocol = tcp
privilege_token = {{token}}
server_addr = {{server ip}}
server_port = {{server port}}
user = {{user}}
dashboard_port = {{port}}
dashboard_user = {{username}}
dashboard_pwd = {{password}}

[Router]
type = http
custom_domains = {{router.customdomain.com}}
local_ip = 192.168.1.1
local_port = 80
use_gzip = false
use_encryption = false

[NAS]
type = http
custom_domains = {{www.customdomain.com}}
local_ip = 192.168.1.250
local_port = 5000
use_gzip = false
use_encryption = false

[File]
type = http
custom_domains = {{www.customdomain.com}}
local_ip = 192.168.1.250
local_port = 80
locations = /file
use_gzip = false
use_encryption = false

[Photo]
type = http
custom_domains = {{www.customdomain.com}}
local_ip = 192.168.1.250
local_port = 80
locations = /photo
use_gzip = false
use_encryption = false

Steps to reproduce the issue:

以上配置用于穿透局域网内群晖NAS

Test01:

  1. 访问 www.customdomain.com 成功进入群晖 DSM 首页
  2. 访问 www.customdomain.com/photo 不能进入 Photo Station,提示 抱歉,您所指定的页面不存在。
  3. 等待直至到 Dashboard 中 [NAS] 的 Connections 为0后再次访问 www.customdomain.com/photo 成功进入 Photo Station

Test02:

  1. 访问 www.customdomain.com/photo 成功进入 Photo Station
  2. 访问 www.customdomain.com 不能进入群晖 DSM 首页,URL被重定向到 www.customdomain.com:5000
  3. 等待直至到 Dashboard 中 [Photo] 的 Connections 为0后再次访问 www.customdomain.com 成功进入群晖 DSM 首页

Describe the results you received:

配置中 URL 路由为 //* 存在冲突

Describe the results you expected:

既能访问 www.customdomain.com 的同时也能访问 www.customdomain.com/*

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

None

Can you point out what caused this issue (optional)

None

Originally created by @sunnyyoung on GitHub (Nov 22, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/533 **What version of frp are you using (./frpc -v or ./frps -v)?** ``` 0.13.0 ``` **What operating system and processor architecture are you using (`go env`)?** Server: ``` Linux ubuntu 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux ``` **Configures you used:** Server: ``` [common] max_pool_count = 32 bind_port = {{server port}} vhost_http_port = 80 vhost_https_port = 443 privilege_token = {{token}} dashboard_port = {{port}} dashboard_user = {{username}} dashboard_pwd = {{password}} ``` Client: ``` [common] log_file = /dev/null log_level = error log_max_days = 1 login_fail_exit = false protocol = tcp privilege_token = {{token}} server_addr = {{server ip}} server_port = {{server port}} user = {{user}} dashboard_port = {{port}} dashboard_user = {{username}} dashboard_pwd = {{password}} [Router] type = http custom_domains = {{router.customdomain.com}} local_ip = 192.168.1.1 local_port = 80 use_gzip = false use_encryption = false [NAS] type = http custom_domains = {{www.customdomain.com}} local_ip = 192.168.1.250 local_port = 5000 use_gzip = false use_encryption = false [File] type = http custom_domains = {{www.customdomain.com}} local_ip = 192.168.1.250 local_port = 80 locations = /file use_gzip = false use_encryption = false [Photo] type = http custom_domains = {{www.customdomain.com}} local_ip = 192.168.1.250 local_port = 80 locations = /photo use_gzip = false use_encryption = false ``` **Steps to reproduce the issue:** 以上配置用于穿透局域网内群晖NAS Test01: 1. 访问 www.customdomain.com 成功进入群晖 DSM 首页 2. 访问 www.customdomain.com/photo 不能进入 Photo Station,提示 `抱歉,您所指定的页面不存在。` 3. 等待直至到 Dashboard 中 [NAS] 的 Connections 为0后再次访问 www.customdomain.com/photo 成功进入 Photo Station Test02: 1. 访问 www.customdomain.com/photo 成功进入 Photo Station 2. 访问 www.customdomain.com 不能进入群晖 DSM 首页,URL被重定向到 www.customdomain.com:5000 3. 等待直至到 Dashboard 中 [Photo] 的 Connections 为0后再次访问 www.customdomain.com 成功进入群晖 DSM 首页 **Describe the results you received:** 配置中 URL 路由为 `/` 与 `/*` 存在冲突 **Describe the results you expected:** 既能访问 www.customdomain.com 的同时也能访问 www.customdomain.com/* **Additional information you deem important (e.g. issue happens only occasionally):** None **Can you point out what caused this issue (optional)** None
gitea-mirror 2026-05-05 12:13:58 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@idoall commented on GitHub (Nov 22, 2017):

群晖+docker更好用一些,把frpc设置到docker中如果有其他服务,就新启动一个容器。

如果想外网访问DSM,直接用群晖的DDNS即可

<!-- gh-comment-id:346283977 --> @idoall commented on GitHub (Nov 22, 2017): 群晖+docker更好用一些,把frpc设置到docker中如果有其他服务,就新启动一个容器。 如果想外网访问DSM,直接用群晖的DDNS即可
Author
Owner

@sunnyyoung commented on GitHub (Nov 22, 2017):

@idoall
群晖内部运行 Docker 的话会影响到休眠吧?这个比较不可控,因此我的 frpc 是放在路由器上的(软路由)
我没有公网IP,DDNS这个不行,群晖提供的 QuickConnect 速度太慢了

<!-- gh-comment-id:346288365 --> @sunnyyoung commented on GitHub (Nov 22, 2017): @idoall 群晖内部运行 Docker 的话会影响到休眠吧?这个比较不可控,因此我的 frpc 是放在路由器上的(软路由) 我没有公网IP,DDNS这个不行,群晖提供的 QuickConnect 速度太慢了
Author
Owner

@idoall commented on GitHub (Nov 23, 2017):

不会休眠,我的网站就是这样挂的,你用阿里云的ddns,不用群晖自己的

<!-- gh-comment-id:346626511 --> @idoall commented on GitHub (Nov 23, 2017): 不会休眠,我的网站就是这样挂的,你用阿里云的ddns,不用群晖自己的
Author
Owner

@fatedier commented on GitHub (Dec 7, 2017):

url 路由目前只解析每一个连接的第一个请求。浏览器对于同一个域名的请求可能会复用连接,所以同一个连接中的后续请求不会再被转发。这个目前还没有太好的解决方法,之后考虑下要怎么优化。

<!-- gh-comment-id:349864467 --> @fatedier commented on GitHub (Dec 7, 2017): url 路由目前只解析每一个连接的第一个请求。浏览器对于同一个域名的请求可能会复用连接,所以同一个连接中的后续请求不会再被转发。这个目前还没有太好的解决方法,之后考虑下要怎么优化。
Author
Owner

@fatedier commented on GitHub (Dec 15, 2017):

0.14.1 版本优化 http 类型的 proxy,可以尝试下。

<!-- gh-comment-id:351969129 --> @fatedier commented on GitHub (Dec 15, 2017): 0.14.1 版本优化 http 类型的 proxy,可以尝试下。
Author
Owner

@sunnyyoung commented on GitHub (Dec 17, 2017):

@fatedier 访问已正常,感谢!

<!-- gh-comment-id:352254258 --> @sunnyyoung commented on GitHub (Dec 17, 2017): @fatedier 访问已正常,感谢!
Author
Owner

@sunnyyoung commented on GitHub (Dec 21, 2017):

貌似 HTTPS 的复用也有上述问题呃

<!-- gh-comment-id:353363330 --> @sunnyyoung commented on GitHub (Dec 21, 2017): 貌似 `HTTPS` 的复用也有上述问题呃
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#413
No description provided.