CentOS7 升级nginx1.12 到 nginx1.17

升级过程
阿里云一直在报错提示有一个nginx漏洞。Nginx HTTP/2和mp4模块远程拒绝服务漏洞

创建文件 /etc/yum.repo.d/nginx.repo

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

如果是RHEL则如下内容

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

再执行 yum update nginx 即可,升级之后,再重新启动nginx。

报错

nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/vhost/site1.conf:14
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/vhost/pma.conf:26

移除 ssl onlisten 443 http2 ssl 加入即可。nginx 1.17 比 nginx1.12配置更清晰。

状态

[root@f2 vhost]# systemctl status nginx
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-05-21 11:14:47 CST; 2 months 9 days ago
     Docs: http://nginx.org/en/docs/
 Main PID: 9408 (nginx)
   CGroup: /system.slice/nginx.service
           ├─ 9408 nginx: master process /usr/sbin/nginx
           ├─ 9410 nginx: worker process is shutting down
           ├─30376 nginx: worker process
           └─30377 nginx: worker process

May 21 11:14:47 fl2 systemd[1]: Starting The nginx HTTP and reverse proxy server...
May 21 11:14:47 fl2 nginx[15219]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
May 21 11:14:47 fl2 nginx[15219]: nginx: configuration file /etc/nginx/nginx.conf test is successful
May 21 11:14:47 fl2 systemd[1]: Started The nginx HTTP and reverse proxy server.

参考:https://www.prado.lt/5-minute-upgrade-nginx-1-12-to-1-17-on-centos-7-rhel-7

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值