https的配置 包含wss的配置


    server {
        
        #SSL 访问端口号为 443
        listen 443 ssl; 
        #填写绑定证书的域名
        server_name xxx.xxx.com;
        #证书文件名称
        ssl_certificate ssl/1_xxx.xxx.com_bundle.crt; 
        #私钥文件名称
        ssl_certificate_key ssl/2_xxx.xxx.com.key; 
        ssl_session_timeout 5m;
        #请按照以下协议配置
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
        #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 
        ssl_prefer_server_ciphers on;

    
        location / {
            proxy_pass http://vvv.vvv.com/;
        }
        location /websocket {
            proxy_pass http://vvv.vvv:8003/; # websocket 链接
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
        
    }

    server {
        listen 80;
        
        server_name xxx.xxx.com;
        location / {
            proxy_pass http://vvv.vvv.com/;
        }

        location /websocket {
            proxy_pass http://vvv.vvv:8003/; # websocket 链接
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
        
    }

    
   

posted @ 2022-02-15 16:00  柯宝宝智商感人  阅读(248)  评论(0编辑  收藏  举报