Languages
[Edit]
EN

apache2 - http2 / h2 proxy configuration with WampServer

8 points
Created by:
Marley-Marks
712

In this short article we would like to show how to configure http2 (called h2 over TSL) proxy with Apache 2.4.

Note: presented below configuration shoul be working on Linux too.

1. Prerequrements

Edit

Go to this article to see how to confiugure http2 / h2 that is requred by h2 proxy.

Note: configuration was tested on Apache 2.4.39 installed as WampServer x64 under Windows 10.

2. Enabling Apache 2.4 modules

Edit

In this case we need to enable only 2 modules: proxy_module and proxy_http2_module.

We can do it in 2 ways:

  • from context menu:
    Apache -> Apache modules -> proxy_module
    Apache
    -> Apache modules -> proxy_http2_module
    optionally we can enable:
    Apache -> Apache modules -> proxy_http_module
  • from configuration file c:\wamp64\bin\apache\apache2.4.39\conf\httpd.conf by uncommenting following lines:
    optionally we can enable:

3. Setting Apache 2.4 configurations

Edit

It is necessary to create new one VirtualHost with http2 / h2 proxy.

We should select one of below configuration.

3.1. Simple solution

Edit

This approach is useful when we have proxy on same apache2 server and it is not required to verify corectness of certificate.

Solution: open c:\wamp64\bin\apache\apache2.4.39\conf\extra\httpd-vhosts.conf file and add as last configuration following VirtualHost:

Where:

  • https://localhost/tomcat will be redirected to https://localhost:8080 with h2 protocol,
  • reverse proxy will provide bidirectional communication that is required by http2 protocol.

Note: read this article to know more about http2 / h2 proxy configuration.

3.2. Disabled verification

Edit

This approach is useful when servers are in internal network and we don't need to take care of additional security - checking details of certificates like domain, whi signed certificate etc. can be disabled.

e.g. we want to redirect requests from Apache 2.4 to Spring Boot Application that uses Tomcat 9

Solution: open c:\wamp64\bin\apache\apache2.4.39\conf\extra\httpd-vhosts.conf file and add as last configuration following VirtualHost:

4. Verify HTTP2 / h2 pxoxy

Edit

Type in web browser address bar https://localhost/tomcat and confirm with Enter key.

Screenshot:

http2 / h2 proxy from Apache 2.4 to Spring Boot Application with Tomcat 9
http2 / h2 proxy from Apache 2.4 to Spring Boot Application with Tomcat 9
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Apache2

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join