Skip to content

support nginx-1.31.0#343

Open
yuwenlong wants to merge 1 commit into
chobits:masterfrom
yuwenlong:master
Open

support nginx-1.31.0#343
yuwenlong wants to merge 1 commit 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
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