[GH-ISSUE #2852] Nginx无法使用proxy_protocol功能 #2279

Closed
opened 2026-05-05 13:28:11 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @smallfish01 on GitHub (Mar 17, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2852

Bug Description

今天突然发现通过内网去访问同属于内网的两台Nginx服务器都访问不了了,网页打不开,但是在外网访问正常,查看服务器/var/log/nginx/error日志发现:
2022/03/17 17:58:20 [error] 75479#0: *660 broken header: "^V^C^A^B^@^A^@^Aü^C^C¾¯oHPñÂf <98>2ïj<96>^BÁ^B^O«6^Y<92>~Î"sJ£qØ^HE NÖ2<9a><9e><92>ñ½t<8e><93>C?<81><9f>^^.x<99>&j²^KÏõÂ<83>®ç1<8f>á^@ ºº^S^A^S^B^S^CÀ+À/À,À0̨̩À^SÀ^T^@<9c>^@<9d>^@/" while reading PROXY protocol, client: 192.168.1.7, server: 0.0.0.0:443

192.168.1.7是公司内网客户端IP。

在Nginx配置文件里取消以下相关设置后正常:
listen 443 ssl http2 proxy_protocol;
real_ip_header proxy_protocol;
set_real_ip_from 192.168.1.5/32; // FRP Server IP

这几天没做什么改动,只是将FRP从0.38.1升级到0.4,而且内网访问不走frp,不知道为什么会这样?理

frpc Version

0.40

frps Version

0.40

System Architecture

linux/amd64

Configurations

listen 443 ssl http2 proxy_protocol;
real_ip_header proxy_protocol;
set_real_ip_from 192.168.1.5/32; // FRP Client IP

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @smallfish01 on GitHub (Mar 17, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2852 ### Bug Description 今天突然发现通过内网去访问同属于内网的两台Nginx服务器都访问不了了,网页打不开,但是在外网访问正常,查看服务器/var/log/nginx/error日志发现: 2022/03/17 17:58:20 [error] 75479#0: *660 broken header: "^V^C^A^B^@^A^@^Aü^C^C¾¯oHPñÂf <98>2ïj<96>^BÁ^B^O«6^Y<92>~Î"sJ£qØ^HE NÖ2<9a><9e><92>ñ½t<8e><93>C?<81><9f>^^.x<99>&j²^KÏõÂ<83>®ç1<8f>á^@ ºº^S^A^S^B^S^CÀ+À/À,À0̨̩À^SÀ^T^@<9c>^@<9d>^@/" while reading PROXY protocol, client: 192.168.1.7, server: 0.0.0.0:443 192.168.1.7是公司内网客户端IP。 在Nginx配置文件里取消以下相关设置后正常: listen 443 ssl http2 proxy_protocol; real_ip_header proxy_protocol; set_real_ip_from 192.168.1.5/32; // FRP Server IP 这几天没做什么改动,只是将FRP从0.38.1升级到0.4,而且内网访问不走frp,不知道为什么会这样?理 ### frpc Version 0.40 ### frps Version 0.40 ### System Architecture linux/amd64 ### Configurations listen 443 ssl http2 proxy_protocol; real_ip_header proxy_protocol; set_real_ip_from 192.168.1.5/32; // FRP Client IP ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@smallfish01 commented on GitHub (Mar 18, 2022):

经过多次测试,在内网nginx服务器上,增加另外一个端口解决:
listen 8443 ssl http2 proxy_protocol;

然后在frpc.ini上配置:
[www]
type = https
local_port = 8443
local_ip = 192.168.1.10
custom_domains = xxx.domain.com
proxy_protocol_version = v2

<!-- gh-comment-id:1072224802 --> @smallfish01 commented on GitHub (Mar 18, 2022): 经过多次测试,在内网nginx服务器上,增加另外一个端口解决: listen 8443 ssl http2 proxy_protocol; 然后在frpc.ini上配置: [www] type = https local_port = 8443 local_ip = 192.168.1.10 custom_domains = xxx.domain.com proxy_protocol_version = v2
Author
Owner

@peaceanddemocracy commented on GitHub (May 30, 2022):

大佬,我也碰到了这个问题,开了proxy_protocol之后404界面,不知道怎么操作?

<!-- gh-comment-id:1141095573 --> @peaceanddemocracy commented on GitHub (May 30, 2022): 大佬,我也碰到了这个问题,开了proxy_protocol之后404界面,不知道怎么操作?
Author
Owner

@smallfish01 commented on GitHub (Jun 12, 2022):

大佬,我也碰到了这个问题,开了proxy_protocol之后404界面,不知道怎么操作?

上面不是有配置么。

<!-- gh-comment-id:1153102314 --> @smallfish01 commented on GitHub (Jun 12, 2022): > 大佬,我也碰到了这个问题,开了proxy_protocol之后404界面,不知道怎么操作? 上面不是有配置么。
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#2279
No description provided.