Включить поддержку ALPN+HTTPS/2 в CentOS+nginx

#Актуальную версию смотрим https://www.openssl.org/source/
OPENSSL=»openssl-1.0.2l»
#Актуальную версию смотрим http://nginx.org/packages/mainline/centos/7/SRPMS/
NGINX=»nginx-1.13.0-1″

yum -y groupinstall ‘Development Tools’
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel

mkdir -p /opt/lib
wget https://www.openssl.org/source/$OPENSSL.tar.gz -O /opt/lib/$OPENSSL.tar.gz
tar -zxvf /opt/lib/$OPENSSL.tar.gz -C /opt/lib

rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/$NGINX.el7.ngx.src.rpm
sed -i «s|—with-http_ssl_module|—with-http_ssl_module —with-openssl=/opt/lib/$OPENSSL|g» /root/rpmbuild/SPECS/nginx.spec
rpmbuild -ba /root/rpmbuild/SPECS/nginx.spec
rpm -Uvh /root/rpmbuild/RPMS/x86_64/$NGINX.el7.centos.ngx.x86_64.rpm

Проверяем тут https://tools.keycdn.com/http2-test
Должно быть

HTTP/2 Test Result domain.ru

Yeah! domain.ru supports HTTP/2.0.
ALPN supported.

Добавить комментарий