咸鱼韭菜

专注LANMP

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
ubuntu 搭建简易的https网站

环境:ubuntu 12.04.5 openssl
(1)创建一个ssl的保存路径 sudo mkdir /opt/nginx/ssl
(2)生存密钥sudo openssl genrsa -out key.pem 2048
(3)sudo openssl req -new -x509 -nodes -out server.crt -keyout server.key
(4)配置nginx
  server {
    listen 443;
    index index.html index.php;
    root /home/www;
    ssl on;
    ssl_certificate  /opt/nginx/ssl/server.crt;
    ssl_certificate_key /opt/nginx/ssl/server.key;
}

 

简单配置
listen 0.0.0.0:443; ssl on; ssl_certificate /opt/nginx/conf/csc.pem; ssl_certificate_key /opt/nginx/conf/csc.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1;

 

posted on 2016-07-06 14:13  咸鱼韭菜  阅读(743)  评论(0编辑  收藏  举报