https直播室连接文字服务器时会报错,因为文字服务器的地址一般是http的,利用nginx(或其他)给文字服务器地址加层代理即可,例如:
server {
listen 443 ssl;
server_name 180.178.45.98;
location / {
proxy_pass http://112.74.162.39:9011;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
应该这样:
server {
listen 443 ssl;
server_name www.xxx.com;
ssl_certificate C:/nginx-1.14.0/conf/ssl/full_chain.pem;
ssl_certificate_key C:/nginx-1.14.0/conf/ssl/private.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location /socket {
proxy_pass http://112.74.162.39:9011;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_pass http://103.224.248.72:8080/;
}
}
网友评论