# nginx -V nginx version: nginx/1.9.6 built by gcc 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_v2_module --with-http_geoip_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
You can see that the version is now 1.9.6, and that --with-http_v2_module has been added to the configure arguments.
The key point is to swap the previously installed http_spdy_module for http_v2_module and rebuild. If there is no --with-http_spdy_module, simply add --with-http_v2_module.
Modifying the Nginx server Directive
Update it so that ssl supports HTTP/2.0.
1 2 3
server { - listen 443; + listen 443 ssl http2;
Nginx configure test & reload
Run a configure test.
If you don’t see syntax is ok as shown below, there’s an error in your configuration, so fix it.
1 2 3 4
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
Reload the configuration.
1
# nginx -s reload
That completes the setup. We were able to upgrade the version with zero downtime and install http_v2_module.
Now let’s access a page served over the https scheme right away.
Verifying the HTTP/2.0 Configuration
Verify with the SPDY indicator extension for the Chrome browser
Verify in FireFox via Developer Tools > Network > Headers