[GH-ISSUE #1346] windows作为客户端使用plugin static_file访问一直返回404 #1067

Closed
opened 2026-05-05 12:41:08 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @lujiahaoo on GitHub (Jul 31, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1346

What version of frp are you using (./frpc -v or ./frps -v)?
frps:0.27.1
frpc:0.27.1
What operating system and processor architecture are you using (go env)?
Server: Linux3.10 - Centos7 | Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz
Client: Windows 10 家庭中文版 InteI(R) Core(TM) i5-7200U CPU @2.50GHZ 2.70GHZ
Configures you used:
Server:

bind_port = 7000
dashboard_port =7500
dashboard_user =ljh
dashboard_pwd =ljh

Client:

[common]
server_addr = myip
server_port = 7000

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

[static_file]
type = tcp
remote_port = 7250
plugin = static_file
plugin_local_path=C:/share
plugin_strip_prefix =share
plugin_http_user =user
plugin_http_passwd =pwd

Steps to reproduce the issue:
1.在Windows C盘根目录下新建文件share,进入文件创建test.txt
2.服务端客户端启动服务
3.浏览器访问 myip:7250/share

Describe the results you received:
浏览器显示404 page not found

Describe the results you expected:
浏览器显示test.txt并且可以下载

Additional information you deem important (e.g. issue happens only occasionally):
登陆 myip:7500 查看dashboard 显示6000,7250端口都online,客户端服务端启动时输出都正常

Can you point out what caused this issue (optional)
会是windows防火墙的问题吗?

Originally created by @lujiahaoo on GitHub (Jul 31, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1346 **What version of frp are you using (./frpc -v or ./frps -v)?** frps:0.27.1 frpc:0.27.1 **What operating system and processor architecture are you using (`go env`)?** Server: Linux3.10 - Centos7 | Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz Client: Windows 10 家庭中文版 InteI(R) Core(TM) i5-7200U CPU @2.50GHZ 2.70GHZ **Configures you used:** Server: ```shell bind_port = 7000 dashboard_port =7500 dashboard_user =ljh dashboard_pwd =ljh ``` Client: ```shell [common] server_addr = myip server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 [static_file] type = tcp remote_port = 7250 plugin = static_file plugin_local_path=C:/share plugin_strip_prefix =share plugin_http_user =user plugin_http_passwd =pwd ``` **Steps to reproduce the issue:** 1.在Windows C盘根目录下新建文件share,进入文件创建test.txt 2.服务端客户端启动服务 3.浏览器访问 myip:7250/share **Describe the results you received:** 浏览器显示404 page not found **Describe the results you expected:** 浏览器显示test.txt并且可以下载 **Additional information you deem important (e.g. issue happens only occasionally):** 登陆 myip:7500 查看dashboard 显示6000,7250端口都online,客户端服务端启动时输出都正常 **Can you point out what caused this issue (optional)** 会是windows防火墙的问题吗?
Author
Owner

@bjgetite commented on GitHub (Aug 2, 2019):

我和你遇到了同样的问题,都换成最新版本也不行...,你怎么解决的?

<!-- gh-comment-id:517528047 --> @bjgetite commented on GitHub (Aug 2, 2019): 我和你遇到了同样的问题,都换成最新版本也不行...,你怎么解决的?
Author
Owner

@bjgetite commented on GitHub (Aug 8, 2019):

我看了别的issues解决了,是在访问路径下结尾是/就可以了,不加/就报404,比如你访问myip:7250/share/就可以

<!-- gh-comment-id:519355256 --> @bjgetite commented on GitHub (Aug 8, 2019): 我看了别的issues解决了,是在访问路径下结尾是/就可以了,不加/就报404,比如你访问myip:7250/share/就可以
Author
Owner

@Nathanlee2010 commented on GitHub (Aug 24, 2019):

我看了别的issues解决了,是在访问路径下结尾是/就可以了,不加/就报404,比如你访问myip:7250/share/就可以

非常感谢

<!-- gh-comment-id:524526907 --> @Nathanlee2010 commented on GitHub (Aug 24, 2019): > 我看了别的issues解决了,是在访问路径下结尾是/就可以了,不加/就报404,比如你访问myip:7250/share/就可以 非常感谢
Author
Owner

@datty258 commented on GitHub (Feb 26, 2021):

我看了别的issues解决了,是在访问路径下结尾是/就可以了,不加/就报404,比如你访问myip:7250/share/就可以

这也行,结尾必须要加/ 。否则就not found。这算是一个bug了。

<!-- gh-comment-id:786567796 --> @datty258 commented on GitHub (Feb 26, 2021): > 我看了别的issues解决了,是在访问路径下结尾是/就可以了,不加/就报404,比如你访问myip:7250/share/就可以 这也行,结尾必须要加/ 。否则就not found。这算是一个bug了。
Author
Owner

@fatedier commented on GitHub (Feb 26, 2021):

@datty258 这里是一个目录,所以需要加 /,如果是文件则不用。这个直接使用的 golang 标准库的逻辑。

<!-- gh-comment-id:786583342 --> @fatedier commented on GitHub (Feb 26, 2021): @datty258 这里是一个目录,所以需要加 /,如果是文件则不用。这个直接使用的 golang 标准库的逻辑。
Author
Owner

@junbujianwpl commented on GitHub (Jan 13, 2023):

@datty258 这里是一个目录,所以需要加 /,如果是文件则不用。这个直接使用的 golang 标准库的逻辑。

在Windows作为client时,下面这句也不能带,带上就404,注释掉就好了,啥原因呢
plugin_strip_prefix = static

几个类似的问题
https://github.com/fatedier/frp/issues/1211
https://github.com/fatedier/frp/issues/2986

<!-- gh-comment-id:1382581240 --> @junbujianwpl commented on GitHub (Jan 13, 2023): > @datty258 这里是一个目录,所以需要加 /,如果是文件则不用。这个直接使用的 golang 标准库的逻辑。 在Windows作为client时,下面这句也不能带,带上就404,注释掉就好了,啥原因呢 plugin_strip_prefix = static 几个类似的问题 https://github.com/fatedier/frp/issues/1211 https://github.com/fatedier/frp/issues/2986
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#1067
No description provided.