Windows服务器安装nginx配置多个ssl证书实现https访问

一.需要下载nginx证书在这里插入图片描述

二.下载nginx稳定版

nginx网址: http://nginx.org/en/download.html
在这里插入图片描述

三.配置nginx

在nginx-1.18.0下创建ssl文件,把你ssl证书放进去.


worker_processes  1;


events {
    
    
    worker_connections  1024;
}


http {
    
    
    include       mime.types;
    default_type  application/octet-stream;


    sendfile        on;

    keepalive_timeout  65;


    server {
    
    
        listen       443 ssl;
        server_name    www.xxxxx.com; #域名
    
        #证书的路径
        ssl_certificate      C:/nginx-1.18.0/ssl/xxxx.pem;
        ssl_certificate_key  C:/nginx-1.18.0/ssl/xxxx.key;
    
        #ssl_session_cache    shared:SSL:1m;
        #ssl_session_timeout  5m;

        #ssl_ciphers  HIGH:!aNULL:!MD5;
        #ssl_prefer_server_ciphers  on;

        location / {
    
    
                proxy_pass http://www.xxxx.com:8085; #域名和端口
        }

    }

        server {
    
    
        listen       443 ssl;
        server_name    www.xxxx.com;
    
        ssl_certificate      C:/nginx-1.18.0/ssl/xxxx.pem;
        ssl_certificate_key  C:/nginx-1.18.0/ssl/xxxx.key;
    
        #ssl_session_cache    shared:SSL:1m;
        #ssl_session_timeout  5m;

        #ssl_ciphers  HIGH:!aNULL:!MD5;
        #ssl_prefer_server_ciphers  on;

        location / {
    
    
                proxy_pass http://www.xxxx.com:8081;
        }

    }
  

}

四.启动nginx,就可以了.有疑问请评论.

猜你喜欢

转载自blog.csdn.net/weixin_45500785/article/details/109125474
今日推荐