Skip to content

fix(nginx): 请求的端口未转发到后端, 导致App报1003错误的问题#62

Merged
jss-tg merged 1 commit into
masterfrom
pr/forwarded-port-fix
May 27, 2026
Merged

fix(nginx): 请求的端口未转发到后端, 导致App报1003错误的问题#62
jss-tg merged 1 commit into
masterfrom
pr/forwarded-port-fix

Conversation

@jss-tg
Copy link
Copy Markdown
Collaborator

@jss-tg jss-tg commented May 27, 2026

  1. 转发协议之后, Spring同时会设置端口, 若不转发请求端口, 会变成协议的默认端口, 导致后端接收到请求的端口和App发送请求的端口不一致,详见:RemoteIpValve类

  2. request_port为1.29.3新增变量, 故升级nginx成最新稳定版 https://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_port

1. 转发协议之后, Spring同时会设置端口, 若不转发请求端口, 会变成协议的默认端口, 导致后端接收到请求的端口和App发送请求的端口不一致

2. request_port为1.29.3新增变量, 故升级nginx成最新稳定版
https://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_port
@jss-tg jss-tg disabled auto-merge May 27, 2026 03:25
@jss-tg jss-tg enabled auto-merge (squash) May 27, 2026 03:25
@jss-tg jss-tg merged commit 40354c0 into master May 27, 2026
2 checks passed
@jss-tg jss-tg deleted the pr/forwarded-port-fix branch May 27, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants