.首先确保机器上安装了openssl和openssl-devel
#yum install openssl
#yum install openssl-devel . server {
listen ssl;
server_name vota.swmmotors.com.cn; ssl_certificate cert/vota.swmmotors.com.cn_bundle.crt; #当前conf/目录下
ssl_certificate_key cert/vota.swmmotors.com.cn.key; ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5;
ssl_protocols TLSv1 TLSv1. TLSv1.;
ssl_prefer_server_ciphers on; location / {
root html;
index index.html index.htm;
}
} .tomcat的配置 <Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort="" /> 变成 <Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort=""
proxyPort="" /> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" /> 上面的value是tomcat自带的,下面的使我们要添加的
<Valve className="org.apache.catalina.valves.RemoteIpValve"
remoteIpHeader="x-forwarded-for"
remoteIpProxiesHeader="x-forwarded-by"
protocolHeader="x-forwarded-proto" /> 原因也很简单,nginx缺少http_ssl_module模块,编译安装的时候带上--with-http_ssl_module配置就行了,但是现在的情况是我的nginx已经安装过了,怎么添加模块,其实也很简单,往下看: 做个说明:我的nginx的安装目录是/usr/local/nginx这个目录,我的源码包在/usr/local/src/nginx-1.6.2目录 nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf: 1.2 Nginx开启SSL模块
切换到源码包: cd /usr/local/src/nginx-1.11.
查看nginx原有的模块 /usr/local/nginx/sbin/nginx -V
在configure arguments:后面显示的原有的configure参数如下: --prefix=/usr/local/nginx --with-http_stub_status_module
那么我们的新配置信息就应该这样写: ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
运行上面的命令即可,等配置完 配置完成后,运行命令 make
这里不要进行make install,否则就是覆盖安装 然后备份原有已安装好的nginx cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
然后将刚刚编译好的nginx覆盖掉原有的nginx(这个时候nginx要停止状态) cp ./objs/nginx /usr/local/nginx/sbin/
然后启动nginx,仍可以通过命令查看是否已经加入成功 /usr/local/nginx/sbin/nginx -V 

nginx tomcat https的更多相关文章

  1. Nginx+Tomcat+Https 服务器负载均衡配置

    这篇过气了! 重新补一个:http://www.cnblogs.com/hackyo/p/6809773.html 由于需要,得搭建个nginx+tomcat+https的服务器,搜了搜网上的发现总是 ...

  2. tomcat 安装配置部署到nginx+tomcat+https

    目录 1 Tomcat简介 2.下载并安装Tomcat服务 2.2 部署java环境 2.3 安装Tomcat 2.4 Tomcat目录介绍 (关注点 bin conf logs webapps) 2 ...

  3. nginx+tomcat https实践

    1. 安装ssl'证书 使用Let's Encrypt 的免费证书: 下载源代码: git clone https://github.com/letsencrypt/letsencrypt 我时阿里云 ...

  4. Window nginx+tomcat+https部署方案 支持ios9

    客户端和 Nginx 之间走的 HTTPS 通讯,而 Nginx 到 Tomcat 通过 proxy_pass 走的是普通 HTTP 连接. 下面是详细的配置(Nginx 端口 80/443,Tomc ...

  5. nginx tomcat https配置方案

    nginx目录下配置: ssl目录下 添加 证书和密码,如图 /etc/nginx/conf.d  下修改配置文件 HTTP域名的配置: ## Basic reverse proxy server # ...

  6. Nginx+Tomcat Https SSL部署方案

    1.软件版本: nginx-1.15+ tomcat-8.0+ 2.先解决一个疑问:Tomcat到底需不需要配置SSL? 答案:不需要 3.SSL申请 使用腾讯云.阿里云的服务器,会更加方便申请.(申 ...

  7. nginx+tomat https ssl 部署 完美解决方案

    关于nginx+tomcat https的部署之前网上一直有2种说法: 1.nginx和tomcat都要部署ssl证书 2.nginx部署ssl证书,tomcat增加ssl支持 在实际的部署过程中ng ...

  8. Tomcat服务器配置https协议(Tomcat HTTPS/SSL 配置)

    通常商用服务器使用https协议需要申请SSL证书,证书都是收费的,价格有贵的有便宜的.它们的区别是发行证书的机构不同,贵的证书机构更权威,证书被浏览器否决的几率更小. 非商业版本可以通过keytoo ...

  9. nginx+tomcat配置https

    nginx代理https后,应用redirect https变成http,很多页面报404.情况类似http://blog.sina.com.cn/s/blog_56d8ea900101hlhv.ht ...

随机推荐

  1. LVS集群简介及使用

    什么是集群 一组通过高速网络互联的计算组,并以单一系统的模式加以管理 将很多服务器集中在一起,提供一种服务,在客户端看来就象是只有一个服务器 可以在付出较低成本的情况下获得在性能,可靠性,灵活性方面的 ...

  2. Python3学习之路~3.1 函数基本语法及特性、返回值、参数、局部与全局变量

    1 函数基本语法及特性 定义: 函数是指将一组语句的集合通过一个名字(函数名)封装起来,要想执行这个函数,只需调用其函数名即可 特性: 减少重复代码 使程序变的可扩展 使程序变得易维护 语法定义: d ...

  3. C++ 常用算法

    http://blog.csdn.net/jgzquanquan/article/details/77185711

  4. 281A

    #include <iostream> #include <string> #include <cctype> using namespace std; int m ...

  5. 20165321实验一Java开发环境的熟悉-1

  6. MySQL--10MySQL图形化管理工具

  7. GCC 用户态&内核态 Makefile

    转了一圈,今天再次回到C 网上一篇博文,个人感觉良心作品,故而拿来重新实现一遍,原作者原文有问题,我这里把他打通了 一.GCC Makefile //hello.c #include <stdi ...

  8. ROSETTA使用技巧随笔--控制Log输出等级

    一般运行ROSETTA,屏幕上的Log很多,而且很复杂,让我们看着眼晕,现在我们可以通过控制Log等级来控制屏幕上输出的东西.  Integer Level 0 Fatal 100 Error 200 ...

  9. cocos2dx 3.x(加载网络自定义头像)

    // //  Connection.h //  XXDemo // //  Created by LeeHonGee on 14-9-4. // // #ifndef __XXDemo__Connec ...

  10. java随机排座位

    //打乱学生顺序 Collections.shuffle(); 容我记个单词 peer: vi.凝视; 盯着看; 隐退,若隐若现; 同等,比得上;n.同辈,同等的人; 贵族; 同伴,伙伴;adj.贵族 ...