mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2387] websocket配置经frp后访问不到 #1899
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#1899
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 @yongnights on GitHub (May 11, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2387
A主机,带有公网ip,安装有nginx,ip解析到域名www.a.com
B主机是局域网内的一台主机,部署有一套前后端分离的项目,vue+springboot,安装有nginx
A主机中frps.ini配置参数如下:
B主机中frpc.ini配置参数如下:
A主机上nginx配置如下:
牵涉到80端口问题,所以配置的是nginx和frp共享80端口
B主机上nginx代理配置如下:
目前遇到的问题:
在B主机上不开启frpc服务,通过浏览器访问B主机ip进而访问项目,一切正常,websocket也能正常通信使用
在B主机上开启frpc后,通过浏览器访问A主机ip解析的域名www.a.com进而访问项目,其他功能都正常,但是websocket无法跟服务端通信。
单独使用websocket客户端软件进行连接测试,
当地址是B主机IP的时候可以连接成功并进行通信。比如:ws://x.x.x.1/websocket/1111111
但是当把地址换成A主机IP解析的域名后进行通信,比如:ws://www.a.com/websocket/1111111,报错如下:
我的理解是在A主机的nginx上收到websocket的有关请求后,不知道如何处理才报错的。
但是我这边不知道要咋配置这个请求处理。
因为A主机nginx中已经配置接收到域名www.a.com的请求后转发给
http://127.0.0.1:6099,也就是frps的vhost_http_port,进而给B主机的80端口,也就是nginx来处理了。如果在A主机的nginx上配置websocket有关的,就像B主机那样的,那B主机上的frpc是否还得再增加有关配置,增加啥样的配置?
还请给一些参考意见,如何解决这个问题,多谢了。
@github-actions[bot] commented on GitHub (Jun 26, 2021):
Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.