Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl"

 
 


出现如图所示错误,处理办法如下

  1. 去nginx解压目录下执行

    ./configure --with-http_ssl_module

  2. 如果报错 ./configure: error: SSL modules require the OpenSSL library.则执行

    yum -y install openssl openssl-devel

    ./configure

    ./configure --with-http_ssl_module

  3. 执行 make(切记不能 make install 会覆盖安装目录)

  4. 将原来 nginx 备份

    cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

  5. 将新的 nginx 覆盖旧安装目录

    cp objs/nginx /usr/local/nginx/sbin/nginx 

    如果报错,执行 cp -rfp objs/nginx /usr/local/nginx/sbin/nginx

  6. 测试 nginx 是否正确

    /usr/local/nginx/sbin/nginx -t 

    如图最后是测试成功的,之前遇到一个错误是我的SSL证书路径有错,修改后测试通过

Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl"的更多相关文章

  1. nginx:[emerg]unknown directive "ssl"

    nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:102 到解压的nginx目录 ...

  2. nginx集群报错“upstream”directive is not allow here 错误

    nginx集群报错“upstream”directive is not allow here 错误 搭建了一个服务器, 采用的是nginx + apache(多个) + php + mysql(两个) ...

  3. Nginx的各种报错总结

    1.Nginx安装过程报错 错误一:软件依赖包未正确安装问题---PCRE依赖包没有安装 ./configure: error: the HTTP rewrite module requires th ...

  4. nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

    当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload   报错类似的错误, nginx: [emerg] unknown directive “ ” in /usr/l ...

  5. nginx: [emerg] unknown directive “ ” in /usr/local/nginx/conf/vhost/XXX.conf:53报错处理

    开发同事发给我一小段nginx配置,加到服务器上之后,执行nginx -s reload时,出现报错: nginx: [emerg] unknown directive “ ” in /usr/loc ...

  6. nginx报错:nginx: [emerg] unknown directive in /etc/nginx/conf.d/test.conf:4

    nginx报错:nginx: [emerg] unknown directive  in /etc/nginx/conf.d/test.conf:4 解决: 第四行出现了 tab 空格 , 换成正常的 ...

  7. nginx: [emerg] unknown directive "聽" in D:\software03\GitSpace\cms\nginx-1.14.0/conf/nginx.conf:36

    nginx: [emerg] unknown directive "聽" in D:\software03\GitSpace\cms\nginx-1.14.0/conf/nginx ...

  8. nginx: [emerg] unknown directive "stub_status" in /home/oscf/nginx/conf/conf.d/ngx_metric.conf

    解压安装过程命令如下: cd /home/oscf #该目录下有nginx压缩包 mkdir nginx tar -zxvf nginx-1.16.0.tar.gz cd nginx-1.16.0 . ...

  9. nginx报错 nginx: [alert] kill(25903, 1) failed (3: No such process)

    当nginx 中报错 时 nginx报错 nginx: [alert] kill(25903, 1) failed (3: No such process) 通过在nginx/sbin,目录下 运行命 ...

随机推荐

  1. [patl2-007]家庭房产

    题目大意:求并查集中集合的个数,及每个集合的详细信息 解题关键:只要不进行unite,集合的根是不会变化的. #include<cstdio> #include<cstring> ...

  2. C++标准库vector以及迭代器

    今天看C++的书,出现了一个新的概念,容器vector以及容器迭代器. vector是同一种对象的集合,每个对象都有一个对应的整数索引值.和string对象一样,标准库将负责管理与存储元素相关的类存. ...

  3. Luogu 3233 [HNOI2014]世界树

    BZOJ 3572 首先看出虚树,然后考虑如何$dp$. 我们先在处理出的虚树上$dp$一遍,处理出虚树上所有点距离最近的关键点(关键点一定在虚树上嘛). 具体来说,先搜一遍处理出每一个点的父亲到它的 ...

  4. Fiddler系统监控参数解读

    转自:https://blog.csdn.net/txj236/article/details/38872855 在对系统监控的过程中,发现ClientConnected和ClientBeginReq ...

  5. [译]Javascript中的本地以及全局变量

    本文翻译youtube上的up主kudvenkat的javascript tutorial播放单 源地址在此: https://www.youtube.com/watch?v=PMsVM7rjupU& ...

  6. Oracle数据库网闸配置注意事项

    1.数据库用户需要的权限 grant select any dictionary to coss; grant alter any procedure to coss; grant create tr ...

  7. ipa包使用命令上传fir.im或者蒲公英

    我们的工程做了自动打包处理,但是每次打完ipa后只是放置于一个共享盘或者本地,为了方便测试,每次都要手动上传上传fir或者蒲公英,比较麻烦.所以研究了一下怎么能在打完包后直接脚本上传到上传fir或者蒲 ...

  8. c# 创建XML文档,解析XML文档

    1.静态函数 using System; using System.Collections.Generic; using System.Linq; using System.Text; using S ...

  9. Puppeteer入门初探

    本文来自网易云社区 作者:唐钊 最近在看 node 爬虫相关的一些东西,我记得还是很久以前常用的 node 爬虫工具还是 superagengt+cherrio,他们的思路是通过发起 http 请求然 ...

  10. 【转】php通过curl跨域向asp.net服务器上传文件及参数

    转:http://blog.sina.com.cn/s/blog_13331dce50102vq32.html 这是一个由php通过调用asp.net接口向asp.net服务器post上传文件及参数并 ...