Jalena Blog

  • 首页
  • 程序开发
    • Java
    • Spring
    • SpringBoot
    • SpringMvc
    • Python
    • Odoo
    • C#
    • SQL
    • Web
    • Linux
  • 移动设备
    • Android
    • Router
  • 杂七杂八
    • 我的废话
    • 音频
    • 视频
    • 常用软件
  • 关于
  1. 首页
  2. 软件开发
  3. Linux
  4. 正文

Nginx 部署Comodo Positive SSL证书

2014-07-19

生成2048位key

root@sg:/etc/nginx# openssl genrsa -out ssl2.me.key 2048
Generating RSA private key, 2048 bit long modulus
......+++
..................................................................................................................................+++
e is 65537 (0x10001)

生成SCR文件

root@sg:/etc/nginx# openssl req -new -key ssl2.me.key -out ssl2.me.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN  (这里输入两位大写字母的国家代码 CN是中国)
State or Province Name (full name) [Some-State]:BJ (这里省份 可以填写简称,一般填写拼音)
Locality Name (eg, city) []:BJ  (这里是城市可以填写简称,一般填拼音)
Organization Name (eg, company) [Internet Widgits Pty Ltd]:ssl2 (组织或公司名)
Organizational Unit Name (eg, section) []: (不填写直接回车)
Common Name (eg, YOUR name) []:ssl2.me  (输入使用ssl的域名,一般不带www)
Email Address []:admin@ssl2.me (填写邮箱,有时候证书是发送到这个邮箱)
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:  (不填写直接回车)
An optional company name []:  (不填写直接回车)

nginx配置

server {
	listen 					80;
	server_name 			jalena.bcsytv.com;
    rewrite     			^(.*) https://$server_name$request_uri? permanent;
}

server {
	listen 			443 ssl spdy;
	server_name 		jalena.bcsytv.com;
	root 			/home/wwwroot/blog;
	ssl 			on;
	ssl_certificate 	/usr/local/nginx/conf/vhost/jalena_bcsytv_com.crt;
	ssl_certificate_key 	/usr/local/nginx/conf/vhost/jalena_bcsytv_com.key;
	ssl_session_timeout  	10m;

	ssl_protocols 			SSLv2 SSLv3 TLSv1;  
	ssl_ciphers 			ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;  
	ssl_prefer_server_ciphers 	on;
}
标签: nginx ssl
最后更新:2025-03-16

Jalena

原创内容,转载请注明出处! 部分内容来自网络,请遵守法律适用!

点赞
< 上一篇
下一篇 >

文章评论

  • Jeremy

    ssl啊。这么好的教程。证书是免费的不?

    2014-07-27
    回复
    • Anonymous

      @Jeremy 之前用的免费的,但是还是不太支持很多手机浏览器。这个淘宝便宜,不到10元,直接的浏览器也多。主要是下放速度超快~

      2014-07-28
      回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复

    【腾讯云】云服务器特惠热卖中
    文章目录
    • 生成2048位key
    • 生成SCR文件
    • nginx配置
    标签聚合
    java Centos odoo 其他 生活 wordpress docker MySql
    分类
    • Android / 4篇
    • C# / 10篇
    • Codec / 9篇
    • Conversion / 14篇
    • Editing / 16篇
    • Java / 47篇
    • Javascript / 3篇
    • Linux / 30篇
    • Odoo / 25篇
    • Python / 6篇
    • SQL / 30篇
    • Web / 3篇
    • Windows / 4篇
    • 我的日记 / 10篇
    • 杂七杂八 / 93篇
    • 软件开发 / 72篇
    • 非线性编辑 / 1篇

    COPYRIGHT © 2026 Jalena Blog. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    蜀ICP备17025376号