[GH-ISSUE #3864] transport.proxyProtocolVersion = "v2"302/400/404 #3072

Closed
opened 2026-05-05 13:59:22 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @cancundeyingzi on GitHub (Dec 20, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3864

Bug Description

toml格式,网址a.打码会被302到网址b.打码
别的全部没动,只换了配置文件
nginx,服务器等全部没任何变动
去掉transport.proxyProtocolVersion = "v2"正常

挂到alist时则会400,同样去掉transport.proxyProtocolVersion = "v2"正常
image
挂python-flask会404,同样去掉transport.proxyProtocolVersion = "v2"正常(绝对没有打错字,frpc也显示 start proxy success")
image
fb9fd2e5b4fb6d9de3adc97e0400293e

frpc Version

0.53

frps Version

0.53

System Architecture

frps:linux/amd64 frpc: windows/amd64

Configurations

[[proxies]]
name = "a"
type = "http"
localPort = 80
customDomains = ["a.打码.top"]
transport.proxyProtocolVersion = "v2"

[[proxies]]
name = "b"
type = "http"
localPort = 80
customDomains = ["b.打码.xyz"]
transport.proxyProtocolVersion = "v2"

nginx配置:

server {
        listen        80;
        server_name  a.打码.top;
        root   "D:/phpstudy_pro/WWW/a.打码.top";
        location / {
            index index.php index.html error/index.html;
            error_page 400 /error/400.html;
            error_page 403 /error/403.html;
            error_page 404 /error/404.html;
            error_page 500 /error/500.html;
            error_page 501 /error/501.html;
            error_page 502 /error/502.html;
            error_page 503 /error/503.html;
            error_page 504 /error/504.html;
            error_page 505 /error/505.html;
            error_page 506 /error/506.html;
            error_page 507 /error/507.html;
            error_page 509 /error/509.html;
            error_page 510 /error/510.html;
            include D:/phpstudy_pro/WWW/i.ccdyz.top/nginx.htaccess;
            autoindex  off;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

Logs

image
127.0.0.1 - - [20/Dec/2023:09:52:09 +0800] "\x00" 302 145 "-" "-"
127.0.0.1 - - [20/Dec/2023:09:52:11 +0800] "\x00" 302 145 "-" "-"
127.0.0.1 - - [20/Dec/2023:09:52:13 +0800] "\x00" 302 145 "-" "-"
127.0.0.1 - - [20/Dec/2023:09:52:15 +0800] "\x00" 302 145 "-" "-"

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 @cancundeyingzi on GitHub (Dec 20, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3864 ### Bug Description toml格式,网址a.打码会被302到网址b.打码 别的全部没动,只换了配置文件 nginx,服务器等全部没任何变动 去掉transport.proxyProtocolVersion = "v2"正常 挂到alist时则会400,同样去掉transport.proxyProtocolVersion = "v2"正常 ![image](https://github.com/fatedier/frp/assets/73635883/b6d8f9cd-046a-4499-884e-b8935b682e3e) 挂python-flask会404,同样去掉transport.proxyProtocolVersion = "v2"正常(绝对没有打错字,frpc也显示 start proxy success") ![image](https://github.com/fatedier/frp/assets/73635883/664a9496-006f-479c-b18d-e6f450d96321) ![fb9fd2e5b4fb6d9de3adc97e0400293e](https://github.com/fatedier/frp/assets/73635883/f0b439b6-afc0-4b0b-874e-bd4e860c863c) ### frpc Version 0.53 ### frps Version 0.53 ### System Architecture frps:linux/amd64 frpc: windows/amd64 ### Configurations ``` [[proxies]] name = "a" type = "http" localPort = 80 customDomains = ["a.打码.top"] transport.proxyProtocolVersion = "v2" [[proxies]] name = "b" type = "http" localPort = 80 customDomains = ["b.打码.xyz"] transport.proxyProtocolVersion = "v2" ``` nginx配置: ``` server { listen 80; server_name a.打码.top; root "D:/phpstudy_pro/WWW/a.打码.top"; location / { index index.php index.html error/index.html; error_page 400 /error/400.html; error_page 403 /error/403.html; error_page 404 /error/404.html; error_page 500 /error/500.html; error_page 501 /error/501.html; error_page 502 /error/502.html; error_page 503 /error/503.html; error_page 504 /error/504.html; error_page 505 /error/505.html; error_page 506 /error/506.html; error_page 507 /error/507.html; error_page 509 /error/509.html; error_page 510 /error/510.html; include D:/phpstudy_pro/WWW/i.ccdyz.top/nginx.htaccess; autoindex off; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } } ``` ### Logs ![image](https://github.com/fatedier/frp/assets/73635883/f4ca9782-23c5-45b9-a923-e0131e0a741c) 127.0.0.1 - - [20/Dec/2023:09:52:09 +0800] "\x00" 302 145 "-" "-" 127.0.0.1 - - [20/Dec/2023:09:52:11 +0800] "\x00" 302 145 "-" "-" 127.0.0.1 - - [20/Dec/2023:09:52:13 +0800] "\x00" 302 145 "-" "-" 127.0.0.1 - - [20/Dec/2023:09:52:15 +0800] "\x00" 302 145 "-" "-" ### 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
gitea-mirror 2026-05-05 13:59:22 -06:00
Author
Owner

@xqzr commented on GitHub (Dec 22, 2023):

listen        80 proxy_protocol;
<!-- gh-comment-id:1867633154 --> @xqzr commented on GitHub (Dec 22, 2023): ```conf listen 80 proxy_protocol; ```
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2024):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1902828633 --> @github-actions[bot] commented on GitHub (Jan 22, 2024): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Author
Owner

@ErixWong commented on GitHub (Feb 25, 2024):

I have the same issue, did you guys get a work around?

<!-- gh-comment-id:1962930162 --> @ErixWong commented on GitHub (Feb 25, 2024): I have the same issue, did you guys get a work around?
Author
Owner

@cancundeyingzi commented on GitHub (Feb 25, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

<!-- gh-comment-id:1962935176 --> @cancundeyingzi commented on GitHub (Feb 25, 2024): 去掉transport.proxyProtocolVersion = "v2" > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?
Author
Owner

@ErixWong commented on GitHub (Feb 25, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

谢谢你的回复。
是的只能这样。但我需要真实IP地址传回。
我试了nginx和jellyfin的SSL,都不行。

<!-- gh-comment-id:1962938555 --> @ErixWong commented on GitHub (Feb 25, 2024): > 去掉transport.proxyProtocolVersion = "v2" > > > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗? 谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。
Author
Owner

@cancundeyingzi commented on GitHub (Feb 25, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。

image
image

<!-- gh-comment-id:1962941305 --> @cancundeyingzi commented on GitHub (Feb 25, 2024): > > 去掉transport.proxyProtocolVersion = "v2" > > > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗? > > 谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。 ![image](https://github.com/fatedier/frp/assets/73635883/873c3151-c852-4d2a-a38b-fb9117cea06e) ![image](https://github.com/fatedier/frp/assets/73635883/d2e5942b-4d33-44ca-8e51-e487c387af1a)
Author
Owner

@cancundeyingzi commented on GitHub (Feb 25, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。

不要在http使用transport.proxyProtocolVersion = "v2"
仅在https中使用...别的不清楚,
截图可以参考

<!-- gh-comment-id:1962941913 --> @cancundeyingzi commented on GitHub (Feb 25, 2024): > > 去掉transport.proxyProtocolVersion = "v2" > > > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗? > > 谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。 不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考
Author
Owner

@ErixWong commented on GitHub (Feb 25, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。

不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考

我只有https站点,但也遇到了这个问题,edge报错说证书为空。很奇怪。

<!-- gh-comment-id:1962946383 --> @ErixWong commented on GitHub (Feb 25, 2024): > > > 去掉transport.proxyProtocolVersion = "v2" > > > > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗? > > > > > > 谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。 > > 不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考 我只有https站点,但也遇到了这个问题,edge报错说证书为空。很奇怪。
Author
Owner

@cancundeyingzi commented on GitHub (Feb 25, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。

不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考

我只有https站点,但也遇到了这个问题,edge报错说证书为空。很奇怪。

在局域网内检查有没有证书问题

<!-- gh-comment-id:1962947980 --> @cancundeyingzi commented on GitHub (Feb 25, 2024): > > > > 去掉transport.proxyProtocolVersion = "v2" > > > > > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗? > > > > > > > > > 谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。 > > > > > > 不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考 > > 我只有https站点,但也遇到了这个问题,edge报错说证书为空。很奇怪。 在局域网内检查有没有证书问题
Author
Owner

@ErixWong commented on GitHub (Feb 26, 2024):

去掉transport.proxyProtocolVersion = "v2"

I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗?

谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。

不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考

我只有https站点,但也遇到了这个问题,edge报错说证书为空。很奇怪。

在局域网内检查有没有证书问题

没有证书问题。
局域网用内网地址访问需要跳过证书检查,如果把域名设到hosts文件就能正常访问。
外网访问,去掉这行就好了。

<!-- gh-comment-id:1963115488 --> @ErixWong commented on GitHub (Feb 26, 2024): > > > > > 去掉transport.proxyProtocolVersion = "v2" > > > > > > I have the same issue, did you guys get a work around?我也遇到同样的问题,请问你们解决了吗? > > > > > > > > > > > > 谢谢你的回复。 是的只能这样。但我需要真实IP地址传回。 我试了nginx和jellyfin的SSL,都不行。 > > > > > > > > > 不要在http使用transport.proxyProtocolVersion = "v2" 仅在https中使用...别的不清楚, 截图可以参考 > > > > > > 我只有https站点,但也遇到了这个问题,edge报错说证书为空。很奇怪。 > > 在局域网内检查有没有证书问题 没有证书问题。 局域网用内网地址访问需要跳过证书检查,如果把域名设到hosts文件就能正常访问。 外网访问,去掉这行就好了。
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#3072
No description provided.