Skip to content

support nginx-1.31.0 - #343

Open
yuwenlong wants to merge 3 commits into
chobits:masterfrom
yuwenlong:master
Open

support nginx-1.31.0#343
yuwenlong wants to merge 3 commits into
chobits:masterfrom
yuwenlong:master

Conversation

@yuwenlong

Copy link
Copy Markdown

Summary

Add proxy_connect_rewrite_103100.patch for nginx 1.31.0 compatibility.

Key Changes

  • ngx_http_parse.c: No changes needed — nginx 1.31.0 already has native CONNECT parsing that routes to sw_spaces_before_host and handles host:port via the standard state machine.
  • ngx_http_request.c: Reuses nginx 1.31.0's built-in host/port processing (r->headers_in.server and r->port) to populate r->connect_host and r->connect_port_n, instead of duplicating parse logic.
  • ngx_http_request.c: Wraps nginx 1.31.0's conditional CONNECT rejection (allow_connect check) with #if !(NGX_HTTP_PROXY_CONNECT).
  • ngx_http_request.h: Adds connect_host, connect_port, connect_port_n fields. Raw parse pointers not needed since nginx 1.31.0's native parser handles CONNECT.
  • ngx_http_variables.c: Adds connect_host and connect_port variables.
  • Uses the new 4-argument ngx_http_validate_host API from nginx 1.31.0.

All hunks apply cleanly to nginx 1.31.0.

- Add proxy_connect_rewrite_103100.patch for nginx 1.31.0
- nginx 1.31.0 has native CONNECT parsing, so no parse.c changes needed
- Reuse nginx 1.31.0's built-in host/port processing to populate
  connect_host and connect_port fields
- Wrap native CONNECT rejection with NGX_HTTP_PROXY_CONNECT guard
- Use new 4-argument ngx_http_validate_host API
nginx 1.31.3 将 ngx_http_process_request_header 中的 CONNECT 检查
重构为嵌套 if 结构,导致旧补丁 hunk chobits#2 上下文失配。
将 #if !(NGX_HTTP_PROXY_CONNECT) 的插入点前移至 cscf 赋值之前,
上下文只取四版本公共行,使补丁同时兼容 1.31.0-1.31.3。
已在 nginx 1.31.0/1.31.1/1.31.2/1.31.3 上验证全部 hunk 应用成功。
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.

1 participant