[GH-ISSUE #1582] Client 端 nginx 提供的 web 服务可以访问,javaweb 提供的 web 服务则无法访问 #1253

Closed
opened 2026-05-05 12:48:02 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @flanliulf on GitHub (Dec 27, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1582

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

What operating system and processor architecture are you using (go env)?
server: aliyun CentOS 7.7 64位
client: macOS Catalina 10.15.2

Configures you used:
Server:
[common]
bind_port = 7100
vhost_http_port = 8080

Client:
[common]
server_addr = xx.xx.xx.xx
server_port = 7100

[web]
type = http
local_port = 9090
custom_domains = www.domain.com

Steps to reproduce the issue:

  1. Client 端启动 nginx 应用程序,端口号为 9090,本地访问 http://localhost:9090, 可以正常返回 nginx 主页面;
  2. 访问 http://www.domain.com:8080, 也可以正常返回 nginx 主页面;
  3. 如果 client 端换做启动 java web 应用程序(springboot 2.1.x), 端口号仍然使用 9090,本地访问 http://localhost:9090/ok, 可以正常返回对应页面结果;
  4. 访问 http://www.domain.com:8080/ok, 则报错;

Describe the results you received:
本地如果是 nginx 的 web 服务可以正常访问,但是 java web 程序的 web 服务无法访问。

报错信息:
do http proxy request error: net/http: timeout awaiting response headers

Describe the results you expected:
希望能够访问到 java web 程序提供的 web 服务。

Additional information you deem important (e.g. issue happens only occasionally):
Client 端本地防火墙已关闭,阿里云对应入方向安全组端口 8080 已设置。

Can you point out what caused this issue (optional)

Originally created by @flanliulf on GitHub (Dec 27, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1582 **What version of frp are you using (./frpc -v or ./frps -v)?** frp_0.30.0 **What operating system and processor architecture are you using (`go env`)?** server: aliyun CentOS 7.7 64位 client: macOS Catalina 10.15.2 **Configures you used:** Server: [common] bind_port = 7100 vhost_http_port = 8080 Client: [common] server_addr = xx.xx.xx.xx server_port = 7100 [web] type = http local_port = 9090 custom_domains = www.domain.com **Steps to reproduce the issue:** 1. Client 端启动 nginx 应用程序,端口号为 9090,本地访问 http://localhost:9090, 可以正常返回 nginx 主页面; 2. 访问 http://www.domain.com:8080, 也可以正常返回 nginx 主页面; 3. 如果 client 端换做启动 java web 应用程序(springboot 2.1.x), 端口号仍然使用 9090,本地访问 http://localhost:9090/ok, 可以正常返回对应页面结果; 4. 访问 http://www.domain.com:8080/ok, 则报错; **Describe the results you received:** 本地如果是 nginx 的 web 服务可以正常访问,但是 java web 程序的 web 服务无法访问。 报错信息: do http proxy request error: net/http: timeout awaiting response headers **Describe the results you expected:** 希望能够访问到 java web 程序提供的 web 服务。 **Additional information you deem important (e.g. issue happens only occasionally):** Client 端本地防火墙已关闭,阿里云对应入方向安全组端口 8080 已设置。 **Can you point out what caused this issue (optional)**
Author
Owner

@fatedier commented on GitHub (Jan 5, 2020):

这个问题应该自行检查自己的 nginx web 服务和 java web 服务的区别,用排除法定位问题,简单猜测是 host 的问题,可尝试 host_header_rewrite 参数。

<!-- gh-comment-id:570845209 --> @fatedier commented on GitHub (Jan 5, 2020): 这个问题应该自行检查自己的 nginx web 服务和 java web 服务的区别,用排除法定位问题,简单猜测是 host 的问题,可尝试 host_header_rewrite 参数。
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#1253
No description provided.