Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update my Nginx with yum on CentOS 7

Tags:

nginx

http2

yum

I used yum install nginx on my ECS server, but the version is not high enough to support http2. After googling around, I added a config file:

/etc/yum.repos.d/nginx.repo

With the content:

[nginx]  
name=nginx repo  
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/  
gpgcheck=0  
enabled=1

Then I run yum update nginx, which gave me the version 1.8.1, which is still not high enough to support http2.

Can anyone help me update my nginx to version 1.9.5 or higher, please?

like image 732
Amile1860 Avatar asked Apr 09 '16 09:04

Amile1860


1 Answers

Update your config file to this

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

you need the mainline repository

like image 79
justcompile Avatar answered Sep 20 '22 14:09

justcompile