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. 线段树教做人系列(1)HDU4967 Handling the Past

    题意:给你n组操作,分别为压栈,出栈,询问栈顶元素.每一组操作有一个时间戳,每次询问栈顶的元素的操作询问的是在他之前出现的操作,而且时间戳小于它的情况.题目中不会出现栈为空而且出栈的情况. 例如: p ...

  2. uniqid() 函数 和 microtime()函数

    uniqid() 函数基于以微秒计的当前时间,生成一个唯一的 ID.语法 uniqid(prefix,more_entropy) 参数     描述prefix     可选.为 ID 规定前缀.如果 ...

  3. centos系统查看本机IP地址

    centos系统查看本机IP地址,输入 ifconfig -a查看 centos查询上网公网IP输入 curl ifconfig.me 命令即可查看 centos查询上网网关IP,tracepath  ...

  4. SpringBoot05 数据操作02 -> JPA接口详解

    概览 JpaRepository 继承 PagingAndSortingRepository 继承 CrudRepository 继承 Repository 1 Repository 这是一个空接口, ...

  5. 03 MD5加密、Base64处理

    1 什么是MD5 信息摘要算法,可以将字符进行加密,每个加密对象在进行加密后都是等长的 应用场景:将用户密码经过MD5加密后再存储到数据库中,这样即使是超级管理员也没有能力知道用户的具体密码是多少:因 ...

  6. GCD 学习(一)简介

    文章摘抄至:http://zhuyanfeng.com/archives/3015 并有一些改动 GCD(Grand Central Dispatch)是从OS X Snow Leopard和iOS ...

  7. CF 1029E Tree with Small Distances

    昨晚随便玩玩搞个div3结果浪翻了…… 强烈谴责D题hack数据卡常 考虑到本题中所要求的最短距离不会大于2,所以我们可以把所有结点到$1$的距离通过对$3$取模分类,考虑到直接自顶向下贪心不满足局部 ...

  8. SSH (Struts2+Spring3.0+Hibernate3)框架(一) 理论

    典型的J2EE三层结构,分为表现层.中间层(业务逻辑层)和数据服务层.三层体系将业务规则.数据访问及合法性校验等工作放在中间层处理.客户端不直接与数据库交互,而是通过组件与中间层建立连接,再由中间层与 ...

  9. Android之九宫格解锁的实现

        <ignore_js_op>                                                  下面是最重要的那个LocusPassWordView ...

  10. [译]Javascript中闭包的各种例子

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