Nginx + https + 免费SSL证书配置指南
请参考 Nginx Wiki http://wiki.nginx.org/NginxHttpSslModule
生成证书
$ openssl genrsa -des3 -out server.key 1024
$ openssl req -new -key server.key -out server.csr
$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
编辑 nginx.conf
server_name YOUR_DOMAINNAME_HERE;
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server.key;
}
OK, 完成了。但这样证书是不被信任的,自己玩玩还行,要被信任请看下面。
以下内容转载自
http://goo.gl/YOb5
http://goo.gl/Gftj
HTTPS(全称:Hypertext Transfer Protocol over Secure Socket Layer),是以安全为目标的HTTP通道,简单讲是HTTP的安全版。即HTTP下加入SSL层,HTTPS的安全基础是SSL,因此加密的详细内容 请看SSL。
它是一个URI scheme(抽象标识符体系),句法类同http:体系。用于安全的HTTP数据传输。https:URL表明它使用了HTTP,但HTTPS存在不同 于HTTP的默认端口及一个加密/身份验证层(在HTTP与TCP之间)。这个系统的最初研发由网景公司进行,提供了身份验证与加密通讯方法,现在它被广 泛用于万维网上安全敏感的通讯,例如交易支付方面。
1、自行颁发不受浏览器信任的SSL证书:
HTTPS的SSL证书可以自行颁发,Linux下的颁发步骤如下:
openssl req -new -key api.bz.key -out api.bz.csr
openssl rsa -in api.bz.key -out api.bz_nopass.key
nginx.conf 的SSL证书配置,使用 api.bz_nopass.key,在启动Nginx是无需输入SSL证书密码,而使用 api.bz.key 则需要输入密码:
server_name sms.api.bz;
listen 443;
index index.html index.htm index.php;
root /data0/htdocs/api.bz;
ssl on;
ssl_certificate api.bz.crt;
ssl_certificate_key api.bz_nopass.key;
......
}
自行颁发的SSL证书虽然能够实现加密传输功能,但得不到浏览器的信任,会出现以下提示:
2、受浏览器信任的StartSSL免费SSL证书:
跟VeriSign一样,StartSSL(网址:http://www.startssl.com,公司名:StartCom)也是一家CA机构,它的根证书很 久之前就被一些具有开源背景的浏览器支持(Firefox浏览器、谷歌Chrome浏览器、苹果Safari浏览器等)。
在今年9月 份,StartSSL竟然搞定了微软:微软在升级补丁中,更新了通过Windows根证书认证程序(Windows Root Certificate Program)的厂商清单,并首次将StartCom公司列入了该认证清单,这是微软首次将提供免费数字验证技术的厂商加入根证书认证列表中。现在,在 Windows 7或安装了升级补丁的Windows Vista或Windows XP操作系统中,系统会完全信任由StartCom这类免费数字认证机构认证的数字证书,从而使StartSSL也得到了IE浏览器的支持。
注册成为StartSSL(http://www.startssl.com) 用户,并通过邮件验证后,就可以申请免费的可信任的SSL证书了。步骤比较复杂,就不详细介绍了,申请向导的主要步骤如下:
startssl在9月微软补丁更新中被支持,使得startssl证书得到承认。
申请流程如下 startssl.com
我的环境是windows 7
请不要使用chrome和IE8,否则将无法生成KEY而无法申请成功。建议使用firefox。
此外我还遇上了点意外,我使用的移动的网络被误判为澳大利亚的IP并收到邮件要求解释。
我将APNIC的查询地址和查询结果发送给对方后帐户才申请成功。
control panel / sign-up 注意填写正确资料。收到邮件后复制验证码。然后可以生成一个证书,注意,startssl.com不是以用户名、密码来验证用户的,是用证书来验证用户 的。
所以生成证书后(火狐会导入证书),注意备份证书。丢失证书后只能重新注册。
登录后还要验证域名才能为该域名生成SSL证书,可以选择在whois里的邮箱、[email protected]、 [email protected]或者[email protected]
然后就可以在Certificates wizard里就可以申请SSL证书了。
有效期一年。
======2009/11/26 update===========
Toolbox
把你申请时的private key拿去Decrypt private key,然后把生成的key保存起来。
然后在Retieve certificate里选择你申请的域名,就可以得到cer文件,保存起来,放到nginx的conf目录。
在nginx里这样配置
server_name security.meettea.com;
listen 443;
index index.html index.htm index.php;
root /data0/htdocs/security.meettea.com;
ssl on;
ssl_certificate security.cer;
ssl_certificate_key security.key;
}
nginx -s reload下如果没有任何提示,就说明配置成功了。
可惜firefox3.5测试,不信任class 1的证书。
==============2009/11/26 update===================
在startssl forum看到官方人员说firefox3.5不支持是因为没有配置好。经过配置解决了firefox 3.5不信任该证书的问题,ubuntu studio下测试通过。
步骤是:获取https://www.startssl.com/certs/ca.pem
获取https://www.startssl.com/certs/sub.class1.server.ca.pem
cat ca.pem sub.class1.server.ca.pem >> ca-certs.crt
cat ca-certs.crt >> security.cer
这是因为需要把startssl的根证书和sub class1的证书附上,因为是他们把证书颁发给你,firefox需要这张证书才认识你的证书。 :)
此外opera测试没通过,这点,连startssl.com自己都没有被opera通过。
Incoming search terms:
- nginx https
- nginx ssl
- Nginx_https免费SSL证书配置指南
- https nginx
- nginx ssl 配置
- startssl
- https
- nginx https 配置
- centos nginx https
- nginx ssl配置
- nginx
- nginx 配置https 证书
- ssl centos nginx
- nginx startssl
- ngix https
- https nginx centos
- nginx配置https
- nginx openssl ssl
- nginx start ssl
- django startssl https
- nginx windows 配置
- nginx 配置https
- https 证书配置
- listen 443 ssl;
- nginx https配置
- nguinx ssl
- nignx ssl 证书配置
- nginx enable ssl
- nginx ssl 证书 生成
- nginx ssl 证书
- CentOS7 nginx配置https
- centos nginx ip https
- centos nginx openssl
- nginx 1.9 https配置
- nginx 配置 ssl
- nginx ssl pem配置
- nginx ca
- nginx http to https
- nginx SSL index页面
- https免证书
- nginx service https
- startssl support domain
- nginx openssl
- 苹果 https nginx
- nginx 配置
- nginx ssl 证书配置
- PHP https nginx
- nginx https设置
- nginx enable https
- nginx https 设置
- nginx https证书
- nginx 免费ssl证书
- nginx openssl 证书
- https crt 生成nginx
- nginx 配置配置https
- nginx ssl key
- nginx 配置 https
- ngix https配置
- nginx配置
- startssl nginx 配置
- nginx ssl default
- nginx htts
- nginx pem证书
- nginx ca证书
- ssl_certificate nginx
- nginx http 转移 https
- ssl nginx配置
- windows https
- nginx TLS v1.2 配置
- startssl nginx
- nginx https openssl
- nginx ssl module
- nginx 证书
- nginx https php
- windows nginx 生成证书
- nignx 支持 ssl
- https ssl
- freessl nginx
- nginx.conf 设置https
- nginx配置ssl证书
- nginx https 证书
- ssl nginx
- aginx https
- nginx pem
- django nginx https
- windows nginx ssl
- nginx 配置ssl证书
- nginx ssl fail
- nginx ssl设置
- https nginx 证书
- nginx ssl_certificate
- nginx http 强制跳转https
- 维基百科 nginx ssl
- https nginx 配置
- nginx 配置私有证书
- nginx windows ssl
- nginx 配置证书
- nginx ssl_certificate配置内容
- centos https ssl
- nginx 配置ssl
- nginx SSL https
- Nginx ssl v3
- nginx http2 ssl
- 配置 https play
- nginx设置https
- nginx sslv3
- nginx https pem
- nginx windows https
- nginx https server
- nginx ssl server
- nignx https
- keytool nginx
- ngnix 配置https
- ngnix 配置
- nginx.crt
- centos nginx ssl
- nginx 启动 https
- ngix ssl windows
- nginx ssl 证书生成
- nigix server.crt
- nginx 强制ssl
- ssl django nginx
- nginx Renegotiation配置
- ssl证书版本和nginx ssl_protocol
- windows nginx 证书
- nginx 443配置
- nginx ssl 2.0
- https 私有证书
- django nginx ssl
- ngnix https 配置
- nginx cert.pem
- nginx 证书生成
- https nginx 免费
- ngnix ssl证书
- HTTP2 nginx ssl
- nginx ssl 安装
- nginx wiki ssl
- ngixn ssl php
- nginx https ssl
- ngix
- nginx tls版本
- openssl startssl
- nginx server.crt
- nginx https 配置详解
- windows nginx https
- windows 配置nginx ssl
- nginx https http
- nginx.conf 配置https
- nginx tsl配置
- ca证书 nginx
- 免费https证书配置
- nginx https无法启动
- https ngix
- ngnix ssl
- nginx ssl config
- nginx ssl证书
- ssl HTTPS centos
- Nginx SSL PEM
- nginx ssl centos
- cas server nginx
- nginx配置https证书,nginx启动报错
- nginx配置443证书
- aginx启用https
- nginx https配置教程
- https: www.buildingyn.com CA Index
- windows nginx 开启ssl
- nginx ssl证书配置
- windows http to https
- nginx listen 443 ssl
- ngnix https 证书
- centos7 nginx 免费证书 apache
- nginx ssl windows
- nginx https 证书配置
- centos7 Nginx https
- nginx配置https证书
- nginx https pem key
- win nginx ssl
- https: : luoli2.com forum.php?x=25117
- nginx HttpSSL
- nginx配置ca证书报错
- www.buildingyn.com
- windows nginx https 配置
- windows nginx 配置ssl
- http www.buildingyn.com CA Index
- https: hjlxq.com play 10966 0 7.html
- nginx 申请https
- nginx start https
- nigix配置ssl证书
- https: www.buildingyn.com CA lndex
- http: www.buildingyn.com
- https: www.hwactive.com down index.html
- http: www.xf258.com play 80326-0-0.html
- win7 nginx https配置
- Nginx https 免费SSL证书配置指南
- window下nginx配置ssl证书
- http: www.zxfuli.com play 2018 1 17.html
- https rymkdjpm
- https 配置 nginx
- nginx https windeos
- https www.9991dd.com html 93 in
- https cert key
- Linux ssl 免费 nginx
- nginx多https
- nginx配置https配置 nginx配置https
- https: www.buildingyn.com
- http: www.xf515.com index.html
- Windows系统Nginx配置https证书
- http: www.7455.com play 97415.html
- http: www.zxfuli.com new.html
- www.hwactive.comdownindex.htm
- http: www.78dj.com play 22874.html
- http: www.hwactive.com down index.html
- www. www.hwactive.com Down index.html
- httbs; www,9991dd.com htm 93in
- WWW.buildingyn.com CA lndex
- http: www.zxfuli.com play 19218 1 1.html
- http: www.zxfuli.com show 2801.html
- http: www.zxfuli.com
- http: www.8zzw.cn play 103504-0-0.html
- http: www.456ting.com play 8149-0-3.html
- http: www.zsetv.com play 2843-0-0.html.
- http: www.15yc.com play 5381 1 1.html
- http: www.q2002.com play 19932 1 1.html
- http: www.abab.com play 581256.html
- http: www.zxfuli.com play 12433 1 1.html
- http: www.aiqudy.com play 585.html
- nginx 所有端口ssl证书
- http: www.15yc.com play 184 1 12.html
- windows nginx 启用https
- https: www.pu860.com htm downlist1 5.htm
- http: www.983qq.com html se 137255.html
- http: www.1gmm.com play 21492 1 1.html
- http: www.zxfuli.com play 3083.html
- http: www.q2002.com play 10114 1 1.htm
- h ttp: luoli2.com forum.php?x=25117
- https 部署 nginx
- http: www.q2002.com play 7212 1 1.html
- https: www.bbb530.com htm index.htm
- https: www.201r.com htm dyplay2 49292.x
- www.1gmm.com
- https: worldwidecop.org cogin.php
- https: rising.sany.com.cn wj.html
- http: sewangchao2.com forum-74-422.html
- https: www.zxfuli.compl 44 1 1.html
- 9991dd.com
- http: www.52zy.com down 71461.html
- www.8688av.com play 10517-0-0.html
- nginx ssl 443没有启动
- http: www.zxfuli.com play 6780 1 1.html
- http: www.949d.com play 25282-0-0.html
- http: www.zxfuli.com play 19654 1 3.html
- http: www.zxfuli.com show 11386.html
- htm downlist1
- https配置 nginx
- http: www.zxfuli.com play 372 2 1.html
- http: www.zxfuli.com play 3216 1 3.html
- http www.983qq.com
- https: www.565656.com ting 303645.htm
- www.bbb530.com
- http: down.winbaicai.com88 down 135.html
- httpwww.147xf.netmoviem2-249.html
- http: www.11wa.com play 11238 1 1.html
- http: www.777780.com html B49.htm
- https: www.bbb550.com htm index.htm
- http: www.799dd.com ?nkzgne=fhv2n
- http: www.xjhyey.com Home lndex index
- 1.http: www.buildingyn.com CA Index)
- httpswww.bbb515.comhtmindex.htm
- https: www.w832.com htm dy2 117132.htm
- http: www.xfplay.com xfsetup.htm?9995
- http: www.4667.com xx 38107_play.html
- https: www.dll1.cn down 3937.html
- http m.sznengli.com lndex.html
- www.bbb550.com
- http: www.52zy.com down 79758.html
- http: www.buildingyn.com CA lndex
- http: www.3242.cn play 39983.html
- http: www.zxfuli.com play 11968.html
- http www.11wa.com
- nginx ssl 证书 配置
- http: www.sexiu228.com indexclear.html
- https: ehall.scuecedu.cn new index.html
- ngeix ssl
- www.xf258.com
- www..buildingyn.com CA Index
- http: www.zsetv.com
- http: www.dgjiajun.com index.html
- https: www.ccc506.com htm index.htm
- https. www.9991dd.com html 93in]
- http: www.147xf.net
- http: www.zxfuli.com play 3216 1 1.html
- www.9991dd.com
- http: www.bbb550.com htm index.htm
- www.15yc.complay 25282 1 5.html
- http: www.xf258.com
- httpS.wwW.dd249cOm
- www.11wa.com
- nginx pem https
- bbb530,com
- http: www.147xf.net play 33320-0-0.html
- xf258.com
- http: www.q295.com play 18305.html
- http: www.9991.dd.com html 93in
- http: www.9991dd.com html 93in
- http: www.8080080.cn play-10966.html
- https: yn.cndocsys.cn Home ynIndex
- http: m.b8yy.com play 25541-0-0.html
- www.983qq.com
- www.pu860.com
- https. www.9991ddcom html 93in
- http: www.sesjj.com play 4089-1-1.html
- yn.cndocsys.cn
- www.zsetv.com
- http: 222.8.149.6:99 lndex.htm
- www.w832.com
- http: new.967111.com sup 3985293.htm
- www.799dd.com
- https: downlist1
- https .www.bbb515..com
- https: 201r·com htm new 2.htm
- http: 0a.dhxx2002.com index.html
- https: https ry.ty365.org ks
- https: dd314.com htm vodlist5
- http: www.q2002.cn play 68861 0 19.html
- http: www.xfplay.com xfsetup.htm?899
- http; www.q2002.com
- www.15yc.com
- https: www.8969.org htm 56 5619.htm
- bbb515com
- www.777780.com
- https: www.com htm down4 8865.htm
- htmvodlist1
- https: www.buildingyn.com index
- http ;cphtt.cn.1024
- http; static,tsptw,com xf2071index,html
- https.www.9995ddcom
- http: www.949d.com
- m.ZSetV.com
- https: www.9 9 9 1 d d.com
- http: x. b8yy.com
- https: x. b8yy.com
- www777780con
- https: www. htm vodlist1 8.htm
- http: www.zsetv
- http: htts..wwwww4664h:con
- htpp yn.cndocsys.cn
- !http: m.b8yy.com list 1-5.html
- http: www.zsetvcom
- http: yn.cndocsys.cn
- https: b8yy
- http: www.15yc.com
- www.q2002.com
- https: WWW.f769.com htm dy2 610477X
- www.9991dd.con
- cndocsys home index
- zsetv·com
- www.45yy.cn
- ttps: ln.cndocsys.cn
- http: ln.cndocsys.cn
- www.bbb.530.com
- bbb550.com
- www.9991ddcom
- www.8zzw.cn
- 8zzw cn
- http: www.7455.com play 11052.html
- httbs www848aacom htm pic2 2219htm
- www.9991dd
- http: www.1gmm.com.
- www.2002com play 3216
- http147xfnet
- https: 11.8.33,170.20000 # lndex
- 949d.com
- www.949d.com
- http: www.zsetv.con list 6.html
- sewangchao2.com
- http: www.zxfuli.com show 2801.htm
- w832.com
- lastrm6
- bbb530
- outlinemk3
- nginx配置https不验证证书
- www.1 dy2. com
- http: www.983.cp
- http; www.hwactive.com Downdex.html
- http: www.buildingyn.com:8090
- knifef67
- stiffzoi
- bbb550
- http www.sexiu
- ngnix https keytool
- ngnix keytool
- nginx免费https
- https: www.9991dd.com
- thinkphp6 ssl nginx
- www.zxfuli.comshow617html
- team6n8
收到老外的邮件提醒,恰好是最后2步,cat ca.pem sub.class1.server.ca.pem >> ca-certs.crt 。多谢
貌似首年免费,次年须要购买,对吗?
是的,第2年 $199