一:开始Nginx的SSL模块

1.1 Nginx如果未开启SSL模块,配置Https时提示错误

1
nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:37

原因也很简单,nginx缺少http_ssl_module模块,编译安装的时候带上--with-http_ssl_module配置就行了,但是现在的情况是我的nginx已经安装过了,怎么添加模块,其实也很简单,往下看: 做个说明:我的nginx的安装目录是/usr/local/nginx这个目录,我的源码包在/usr/local/src/nginx-1.6.2目录

1.2 Nginx开启SSL模块

切换到源码包:

1
cd /usr/local/src/nginx-1.11.3

查看nginx原有的模块

1
/usr/local/nginx/sbin/nginx -V

在configure arguments:后面显示的原有的configure参数如下:

1
--prefix=/usr/local/nginx --with-http_stub_status_module

那么我们的新配置信息就应该这样写:

1
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_modul

运行上面的命令即可,等配置完

配置完成后,运行命令

1
make

这里不要进行make install,否则就是覆盖安装

然后备份原有已安装好的nginx

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

然后将刚刚编译好的nginx覆盖掉原有的nginx(这个时候nginx要停止状态)

1
cp ./objs/nginx /usr/local/nginx/sbin/

然后启动nginx,仍可以通过命令查看是否已经加入成功

1
/usr/local/nginx/sbin/nginx -V 

Nginx 配置Http和Https共存

1
2
3
4
5
6
7
8
9
server {
            listen 80 default backlog=2048;
            listen 443 ssl;
            server_name wosign.com;
            root /var/www/html;
  
            ssl_certificate /usr/local/Tengine/sslcrt/ wosign.com.crt;
            ssl_certificate_key /usr/local/Tengine/sslcrt/ wosign.com .Key;
        }

把ssl on;这行去掉,ssl写在443端口后面。这样http和https的链接都可以用

Nginx 配置SSL安全证书重启避免输入密码

可以用私钥来做这件事。生成一个解密的key文件,替代原来key文件。

1
openssl rsa -in server.key -out server.key.unsecure

Nginx SSL性能调优

1
2
3
4
5
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:37的更多相关文章

  1. nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx//conf/nginx.conf:117

    SSL相关的配置加到了nginx的配置文件中后,nginx竟然启动不起来了 于是用如下命令测试问题所在: /usr/local/nginx/sbin/nginx -c /usr/local/nginx ...

  2. the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf

    一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 原因也很简单,nginx缺少http_ssl_module模块,编译安装的时候带上--with-htt ...

  3. nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in ......

    nginx如果未开启SSL模块,配置https时提示错误 nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_modu ...

  4. nginx 使用HTTPS协议-SSL证书模块报错解决-附nginx安装 : [emerg] the "ssl" parameter requires ngx_http_ssl_module in nginx.c

    Linux系统下ngnix使用HTTPS协议启动报错: nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_modul ...

  5. 已安装nginx支持https配置 the "ssl" parameter requires ngx_http_ssl_module

    原文链接:https://blog.seosiwei.com/detail/28 nginx已安装,ssl模块未安装的解决方法: 如果需要在linux中编译自己的nginx服务器,请参照:https: ...

  6. nginx: [emerg] directive "location" has no opening "{" in /usr/local/nginx//conf/nginx.conf:75

    1.报错:[emerg]directive "location" has no opening "{" in ..... 解决方法: 由于对应行或者附近行的“{ ...

  7. Nginx nginx: [emerg] using regex "\.php$" requires PCRE library 或 编译nginx错误:make[1]: *** [/pcre//Makefile] Error 127

    nginx: [emerg] using regex "\.php$" requires PCRE library  或 编译nginx错误:make[1]: *** [/pcre ...

  8. 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 ...

  9. nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

    nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) ...

随机推荐

  1. 网页授权——扫二维码获取openid

    最近做微信公众平台开发项目时遇到这样一个功能需求:生成一个特定url的二维码,用户扫描二维码后跳转到这个url指定的页面,并在这个页面获得用户的openid.这个功能主要涉及到两方面的技术:生成二维码 ...

  2. LeetCode 226. Invert Binary Tree (反转二叉树)

    Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia:This problem was ...

  3. 《mysql必知必会》读书笔记--存储过程的使用

    以前对mysql的认识与应用只是停留在增删改查的阶段,最近正好在学习mysql相关内容,看了一本书叫做<MySQL必知必会>,看了之后对MySQL的高级用法有了一定的了解.以下内容只当读书 ...

  4. 特征提取方法: one-hot 和 IF-IDF

    one-hot 和 IF-IDF是目前最为常见的用于提取文本特征的方法,本文主要介绍两种方法的思想以及优缺点. 1. one-hot 1.1 one-hot编码 什么是one-hot编码?one-ho ...

  5. eclipse中删除多余的tomcat server

    在eclipse菜单中选择Window--Show View--Server--Servers,打开这个服务窗口,将多余的服务删除即可. 如果每次启动中太卡没反应,那就是服务没选择好,或是端口冲突的原 ...

  6. rpm命令常用选项

    安装rpm包 # rpm -ivh ***.rpm #其中i表示安装,v表示显示安装过程,h表示显示进度 升级rpm包 # rpm -Uvh ***.rpm 删除软件包 # rpm -e PACKAG ...

  7. vue-修改vue项目运行端口号

    一.导语 最近在研究,左侧是导航,右侧是显示对应的内容,左右可单独滚动,不互相影响,如何实现? 萝卜蹲的游戏大家都玩过,白萝卜蹲,白萝卜蹲,白萝卜蹲完红萝卜蹲,可是若是在含有滚动条的页面的情况下,白萝 ...

  8. Android-Async-Http 特性简单分析

    如下是官方文档描述此库的特点: All requests are made outside of your app’s main UI thread, but any callback logic w ...

  9. MQTT——发布报文

    发布报文的知识点并不难,只是多.看过前面几章的读者们应该或多或少都认识服务质量QOS.发布报文跟他的联系最紧的.我们也清楚订阅报文里面虽然也有用到QOS,但是他却没有更进一步的联系.往下看就知道是什么 ...

  10. SimpleMembership续

    自上篇SimpleMembership之后,好久不用,也没有研究,最近把以前写的老程序改进下,原有用户系统升级为SimpleMembership,在升级的过程中发现还有许多问题,经过几天的试验,小有收 ...