Enabling http2 in applications using the TAS nginx buildpack
search cancel

Enabling http2 in applications using the TAS nginx buildpack

book

Article ID: 375293

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

This article describes how to enable http2 in your app, which is using the nginx-buildpack as the app runtime. 

Details on the http2 module can be found here:

https://nginx.org/en/docs/http/ngx_http_v2_module.html

Resolution

To enable http2, you will need to add the flag to the nginx.conf file for your app. An example of this is as follows:

server {
    listen {{port}};
    http2 on;
}

This should then enable http2 for your app. 

Please note that this is specifically for the nginx distribution. For openresty, the list of modules it is built with in the nginx buildpack does not include the --with-http_v2_module

https://github.com/cloudfoundry/buildpacks-ci/blob/6a6d43aca1f97d19c559948aa165433fb6009832/tasks/build-binary-new-cflinuxfs4/builder.rb#L785-L807