HTTP/2 module for Apache httpd
Clone or download
icing * Fixed Bug introduce in v1.12.0 where mod_proxy_http2 no longer set…
… the server name

   on new backend connections.
Latest commit 2213f55 Jan 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
m4 forgotten m4 macro May 22, 2015
mod_http2 * Fixed Bug introduce in v1.12.0 where mod_proxy_http2 no longer set… Jan 18, 2019
test Update of copyright year and readme intro. Jan 7, 2019
.gitignore * started push test cases Sep 7, 2018
AUTHORS corrected index.html, documentation, less locking on task scheduling Mar 11, 2015
COPYING documentation, automake version information Mar 27, 2015
ChangeLog * Fixed Bug introduce in v1.12.0 where mod_proxy_http2 no longer set… Jan 18, 2019
DISCUSS new config options to enable/disable mpm_event hack May 20, 2015
INSTALL 1.0.12-DEVa, removed sandbox, updated Dec 18, 2015
LICENSE license headers Mar 5, 2015 * added test/ to the release tar ball, so that peopl just… Oct 9, 2018
NEWS top level makefile by automake, sandbox built copnfiguration Mar 10, 2015
README switching to markdown README Apr 14, 2015 * Fixed issue where mod_proxy_http2 would trigger an invalid interna… Jan 18, 2019

mod_h[ttp]2 - http/2 for Apache httpd

Copyright 2015-2019 greenbytes GmbH

This repository contains mod_h[ttp]2 and mod_proxy_h[ttp]2 from Apache httpd as a standalone build. It servers as early access to features and fixes before being shipped in the next Apache release. mod_proxy_h[ttp]2 has alpha status and features might be removed again. While mod_h[ttp]2 is production ready and stable as shipped by the Apache project, the versions here in github may contain changes for early experimentation.


mod_h[ttp]2 is an official Apache httpd module, first released in 2.4.17. See Apache downloads to get a released version. mod_proxy_h[ttp]2 has been released in 2.4.23.

What you find here are early experience versions for people who like living on the edge and want to help me test not yet released changes.

If you want HTTP/2 in your production environment, please head over to the official releases at Apache and grab one of those or wait until the various OS distributions have assembled one for you.

Current Version

The versions here are based on the lastest Apache httpd 2.4.x release. There is no guarantee that these will be released unchanged by Apache. But you are welcome to test it and give feedback.


You need a built Apache httpd 2.4.34, including apxs and headers to compile and run this module. Additionally, you need an installed libnghttp2, at least in version 1.7.0. And additionally, you want an installed OpenSSL 1.0.2 or later.


You need an installed recent Apache 2.4.x

If you do not have that or don't know how to get it, look at google, stackoverflow, Apache mailing lists or your Linux distro. Not here!

Apache 2.4.x Packages


See ChangeLog for details.


I decided to make the test suite part of this repository again. The existing suite resides in test Apache httpd test repository and is a set of shell scripts. It works, but I miss features that professional test frameworks bring. The tests included here use pytest which I think is an excellent way to do tests. I use it also in my Let's Encrypt module mod_md.

You can build the module without having the test prerequisites. If you want to run them, however, you need pytest, python and a curl with http2 support. Then you can

> make
> make test


(Disclaimer: the HTTP/2 proxy module is experimental. It can not be considered production ready.)

This module is part of the Apache httpd proxy architecture and functions similar to mod_proxy_http and friends. To configure it, you need to use h2: or h2c: in the proxy URL. Example:

<Proxy "balancer://h2-local">
    BalancerMember "h2://"
<Proxy "balancer://h2c-local">
    BalancerMember "h2c://"

<IfModule proxy_http2_module>
    ProxyPass "/h2proxy" "balancer://h2-local"
    ProxyPassReverse "/h2proxy" "balancer://h2-local"
    ProxyPass "/h2cproxy" "balancer://h2c-local"
    ProxyPassReverse "/h2cproxy" "balancer://h2c-local"

This will only work under the following conditions:

  • the backend speaks HTTP/2, the module will not fallback to HTTP/1.1
  • the backend supports HTTP/2 direct mode (see also H2Direct directive of mod_http2)

All other common httpd proxy directives also apply.

What it will not do and what is untested:

  • fallback to HTTP/1.1
  • be very smart when the number of concurrent streams in the backend differs from the local settings
  • load balance between open connections dynamically
  • forward any HTTP/2 priority information
  • support HTTP/2 PUSH from the backend

What it will do:

  • work with frontend HTTP/1.1 connections
  • reuse open HTTP/2 connections from the balancer
  • with a frontent HTTP/2 connection, all streams against the same backend will be handled in a single thread.


There is the official Apache documentation of the module, which you will not find here.

I also compiled a how to h2 in apache document with advice on how to deploy, configure and verify your mod_h[ttp]2 installation.

Build from git

Still not dissuaded? Ok, here are some hints to get you started. Building from git is easy, but please be sure that at least autoconf 2.68 is used:

> autoreconf -i
> automake
> autoconf
> ./configure --with-apxs=<path to apxs>
> make


Please see the file called LICENSE.


This work has been funded by the GSM Association ( The module itself was heavily influenced by mod_spdy, the Google implementation of their SPDY protocol. And without Tatsuhiro Tsujikawa excellent nghttp2 work, this would not have been possible.

Münster, 07.01.2019,

Stefan Eissing, greenbytes GmbH

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. See LICENSE for details.