| Description: | HTTP/2 support module formod_proxy |
|---|---|
| Status: | Extension |
| Module Identifier: | proxy_http2_module |
| Source File: | mod_proxy_http2.c |
| Compatibility: | Available in httpd 2.4.19 and later |
mod_proxy_http2 supports HTTP/2 only, it doesnot provide any downgrades to HTTP/1.1. This means that the backend needs to support HTTP/2 because HTTP/1.1 will not be used instead.
This modulerequires the service ofmod_proxy, so in order to get the ability of handling HTTP/2 proxy requests,mod_proxy andmod_proxy_http2 need to be both loaded by the server.
mod_proxy_http2 works with incoming fronted requests using HTTP/1.1 or HTTP/2. In both cases, requests proxied to the same backend are sent over a single TCP connection whenever possible (namely when the connection can be re-used).
Caveat: there will be no attempt to consolidate multiple HTTP/1.1 frontend requests (configured to be proxied to the same backend) into HTTP/2 streams belonging to the same HTTP/2 request. Each HTTP/1.1 frontend request will be proxied to the backend using a separate HTTP/2 request (trying to re-use the same TCP connection if possible).
This module relies onlibnghttp2 to provide the core http/2 engine.
This module is experimental. Its behaviors, directives, and defaults are subject to more change from release to release relative to other standard modules. Users are encouraged to consult the "CHANGES" file for potential updates.
Do not enable proxying until you havesecured your server. Open proxy servers are dangerous both to your network and to the Internet at large.
The examples below demonstrate how to configure HTTP/2 for backend connections for a reverse proxy.
ProxyPass "/app" "h2://app.example.com"ProxyPassReverse "/app" "https://app.example.com"
ProxyPass "/app" "h2c://app.example.com"ProxyPassReverse "/app" "http://app.example.com"
The schemes to configure above inProxyPassReverse for reverse proxyingh2 (orh2c) protocols are the usualhttps (resp.http) as expected/used by the user agent.
mod_proxy_http creates the following request notes for logging using the%{VARNAME}n format inLogFormat orErrorLogFormat:
Copyright 2025 The Apache Software Foundation.
Licensed under theApache License, Version 2.0.