Skip to content

feat: support opt-in HTTP/2 for HTTPS upstreams - #14284

Open
Zi-Yi-Ming wants to merge 1 commit into
apache:masterfrom
Zi-Yi-Ming:feat/https-upstream-http2
Open

Zi-Yi-Ming wants to merge 1 commit into
apache:masterfrom
Zi-Yi-Ming:feat/https-upstream-http2

Conversation

@Zi-Yi-Ming

Copy link
Copy Markdown

Description

Add http_version: "2" for upstreams configured with scheme: https. This lets APISIX send ordinary HTTPS requests to a backend over HTTP/2. Omitting the field keeps the existing HTTP/1.1 behavior. The opt-in requires an NGINX core of 1.29.4 or later built with ngx_http_v2_module.

Related issue

Refs #13002. This covers the APISIX data plane portion of the feature request.

Validation

Ran bash t/cli/test_https_upstream_http2.sh on APISIX Runtime 1.4.3 with OpenResty 1.31.9.1. The test alternates requests to two routes that share the same TLS backend and checks the protocol reported by that backend.

  • With scheme: https and http_version: "2", the backend received HTTP/2 on both requests.
  • With scheme: https and no http_version, the backend received HTTP/1.1 on both requests.
  • The test also covers POST body forwarding, both protocols with response buffering disabled, response header rewriting, trusted and untrusted upstream certificates, and rejection of the option for a plain HTTP upstream.

The existing HTTPS/gRPC TLS suite passed 88 assertions. The Admin and Control API validators, all 20 OpenAPI contract tests, make lint, ShellCheck, and git diff --check passed.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

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