申请域名的证书
免费证书网站 可以申请一年期限的免费证书
server配置
server {
listen 443 ssl;
server_name pkws.test.cn;
# ali
ssl_certificate C:/WorkSpaces/nginx-1.18.0/conf/vhost/certs/test.cn/4369852_pkws.test.cn.pem;
ssl_certificate_key C:/WorkSpaces/nginx-1.18.0/conf/vhost/certs/test.cn/4369852_pkws.test.cn.key;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location /{
proxy_pass http://localhost:8108/Pk/webSocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
}
location /Pk/webSocket{
proxy_pass http://localhost:8108/Pk/webSocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
}
}
|