大网数据广告活动
服务器运维问答

Apache mod_proxy with Tomcat 8.5 using http2

· 52CE 我爱测

Is it possible to use mod_proxy in front of an Apache Tomcat 8.5 with the http2 protocol? If yes it would be nice to see an example configuration. Edit Specifically: Is it possible and recommended to use http2 between the client …

问题原文

原帖链接 · yglodt · CC BY-SA 3.0

Is it possible to use mod_proxy in front of an Apache Tomcat 8.5 with the http2 protocol? If yes it would be nice to see an example configuration.

Edit

Specifically: Is it possible and recommended to use http2 between the client and the server (Apache httpd), and continue the data stream with ajp between Apache httpd and Apache Tomcat?

Edit 2

This answer provides some details about the topic:

https://stackoverflow.com/questions/35697681/can-we-use-apache-to-deliver-http-2-connection-for-a-java-application-server

已采纳解答

原帖链接 · Barry Pollard · CC BY-SA 4.0

Apache httpd added HTTP/2 proxy support from 2.4.21 but suggest you run latest (2.4.27 at time of writing) as this module is still changing quite a bit at the moment.

Tomcat has just added HTTP/2 support in Tomcat 9: https://readlearncode.com/configure-tomcat-9-for-http2/

So in theory this should all fit together nicely if you're willing to upgrade to those versions (and install OpenSSL 1.0.2 or above required for HTTP/2).

However, in practice it's still all very new, so bugs are possible. To be perfectly honest, the biggest gains from HTTP/2 are with higher-latency connections like client-to-server. Server-to-server connections like Apache to Tomcat using mod_proxy will see fewer gains.

So, given how new these are, you may wish to just use HTTP/2 on your Apache web server (or any other web server which supports HTTP/2), and use mod_proxy to connect to Tomcat via HTTP/1.1 or AJP. This will give you most of the performance gains of HTTP/2 without the hassle and risk of upgrading everything to get full end-to-end HTTP/2.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。