首页 > Web开发 > 详细

使用阿里云的与域名证书配置基于openresty的https站点

时间:2021-03-08 19:57:31      阅读:58      评论:0      收藏:0      [点我收藏+]

准备条件

确认服务器的工具和环境

1 openssl版本

技术分享图片

 

2 openresty版本

技术分享图片

 

 

3 阿里云域名证书 nginx版本

技术分享图片

 

 

 

https的配置

 

 

# HTTPS server
    #
    server {
        listen       443 ssl;
        #域名
        server_name  你的域名;
         #证书位置
        ssl_certificate      你的证书.pem;
        ssl_certificate_key  你的证书.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
         #协议配置
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers  ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!aNULL:!MD5:!ADH:!RC4;
        ssl_prefer_server_ciphers  on;

        location /v1
        {
		#代理某个API端口
            proxy_pass http://127.0.0.1:1234/v1;
        }
       
        location / {
            #root   html/SSLROOT;
            #转发到http
            proxy_pass http://127.0.0.1;
        }

    }

  

重启openrestay ,完工

openresty -p `pwd` -c 你的配置.conf -s reload

 

使用阿里云的与域名证书配置基于openresty的https站点

原文:https://www.cnblogs.com/xiloweiEVE/p/14501067.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!