Skip to content

Commit c57b980

Browse files
author
Daniel Mikusa
authored
Modify default Tomcat configuration to include HTTP/2 support (#906)
This commit will enable HTTP/2 upgrade support, specifically H2C, in the Tomcat configuration that is generated by the buildpack. This will enable HTTP/2 by default. It cannot be disabled, unless you use the Java buildpack's feature to use external Tomcat configuration. The impact should be minimal as you will still retain full HTTP/1.1 support, HTTP/2 will not be forced on clients, and a client would need to request HTTP/2. This commit should also support Java 8+ because we are using H2C, so the additional TLS requirements that precipitate using Java 9+ do not apply. Full HTTP/2 support requires running a version of Cloud Foundry that also includes support for HTTP/2, or use via the container to container network. Signed-off-by: Daniel Mikusa <[email protected]>
1 parent 91aefac commit c57b980

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/tomcat/conf/server.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
<Server port='-1'>
2020

2121
<Service name='Catalina'>
22-
<Connector port='${http.port}' bindOnInit='false' connectionTimeout='20000'/>
22+
<Connector port='${http.port}' bindOnInit='false' connectionTimeout='20000'>
23+
<UpgradeProtocol className='org.apache.coyote.http2.Http2Protocol' />
24+
</Connector>
2325

2426
<Engine defaultHost='localhost' name='Catalina'>
2527
<Valve className='org.apache.catalina.valves.RemoteIpValve' protocolHeader='x-forwarded-proto'/>

0 commit comments

Comments
 (0)