From 9ce52c5ab0e8ba321f93af5ca851352d561067ad Mon Sep 17 00:00:00 2001 From: Ben Jee Date: Tue, 2 Jun 2026 22:46:38 -0700 Subject: [PATCH] Add document for upstream http2 --- .../upstream-http2-appprotocol.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 content/ngf/traffic-management/upstream-http2-appprotocol.md diff --git a/content/ngf/traffic-management/upstream-http2-appprotocol.md b/content/ngf/traffic-management/upstream-http2-appprotocol.md new file mode 100644 index 000000000..6ba63fa65 --- /dev/null +++ b/content/ngf/traffic-management/upstream-http2-appprotocol.md @@ -0,0 +1,196 @@ +--- +title: Configure upstream HTTP/2 through Service appProtocol +toc: true +weight: 1600 +f5-content-type: how-to +f5-product: FABRIC +f5-docs: DOCS-0000 +description: Configure NGINX Gateway Fabric to use HTTP/2 for upstream connections by setting appProtocol to kubernetes.io/h2c on a Kubernetes Service port. +f5-keywords: NGINX Gateway Fabric, HTTP/2, upstream HTTP/2, appProtocol, kubernetes.io/h2c, proxy_http_version, h2c, upstream connections, Service appProtocol, Gateway API, HTTPRoute, GRPCRoute +f5-summary: This guide shows you how to configure NGINX Gateway Fabric to proxy requests to upstream services over HTTP/2 by setting appProtocol to kubernetes.io/h2c on a Kubernetes Service port. Using HTTP/2 for upstream connections enables multiplexing and reduces latency for services that support it. This guide is for operators and developers who have NGINX Gateway Fabric installed and are familiar with Kubernetes Services and the Gateway API. +--- + +Learn how to configure NGINX Gateway Fabric to use HTTP/2 when proxying requests to upstream services using the Service `appProtocol`. + +## Overview + +The `appProtocol` field on a Kubernetes Service provides a way to specify an application protocol for each Service port. Implementations of a controller such as NGINX Gateway Fabric use this field to offer richer behavior for protocols that are understood. For more information, view the official [Kubernetes Service Documentation](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol). + +When a Kubernetes Service port has `appProtocol` set to `kubernetes.io/h2c`, NGINX Gateway Fabric configures the corresponding NGINX location to use HTTP/2 for upstream connections by setting the [`proxy_http_version`](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version) directive to `2` in the NGINX configuration. + +## Before you begin + +- [Install]({{< ref "/ngf/install/" >}}) NGINX Gateway Fabric. + +## Set up + +Create the **coffee** application in Kubernetes by copying and pasting the following block into your terminal: + +```yaml +kubectl apply -f - < 80/TCP 10s +``` + +## Create the Gateway API resources + +Create the **cafe** Gateway: + +```yaml +kubectl apply -f - <