2.4 Nginx 配置HTTPS

当前配置文件内容

        #1.配置上游服务器  www.tomcats.com
        upstream tomcats {
                server 192.168.88.135:8080 weight=1;
                server 192.168.88.136:8080 weight=1;
                server 192.168.88.137:8080 weight=2;
        }

        server {
                listen 80;
                server_name www.tomcats.com;
                location / {
                        proxy_pass http://tomcats;
                }
        }

配置nginx

        #1.配置上游服务器  www.tomcats.com
        upstream tomcats {
                server 192.168.88.135:8080 weight=1;
                server 192.168.88.136:8080 weight=1;
                server 192.168.88.137:8080 weight=2;
        }

        server {
            listen 443;
            server_name www.tomcats.com;
            # 开启https
            ssl on; 
            # 配置证书位置
            ssl_certificate  cert/214292799730473.pem;
            # 配置证书密钥
            ssl_certificate_key cert/214292799730473.key;
            # 配置session会话超时时间 
            ssl_session_timeout 5m;
            # 配置加密套件,写法遵循openssl标准
            ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_prefer_server_ciphers on;
            location / {
                proxy_pass http://tomcats;
            }
        }

你可能感兴趣的:(2.4 Nginx 配置HTTPS)