Centos 7 配置 Nginx 官方源

  • 环境:

    • CentOS Linux release 7.6.1810 (Core)

      [root@localhost]# cat /etc/redhat-release
      CentOS Linux release 7.6.1810 (Core)
      
  • 一、配置官方源

    [root@localhost]# vim /etc/yum.repos.d/nginx.repo
      
    ------------------nginx.repo--------------------------  
    [nginx-stable]
    name=nginx stable repo
    baseurl=https://nginx.org/packages/centos/7/$basearch/
    gpgcheck=1
    enabled=1
    gpgkey=https://nginx.org/keys/nginx_signing.key
    module_hotfixes=true
    
  • 二、建立缓存

    yum makecache
    
  • 三、安装

    yum install nginx
    
  • 附:nginx官网文档