知識(shí)付費(fèi)現(xiàn)在文檔中說(shuō)明不能使用https,原因是需要配置wss;
第一步:nginx配置wss
nginx配置參考
1、已經(jīng)安裝nginx,版本不低于1.3
2、知識(shí)付費(fèi)Workerman監(jiān)聽(tīng)的是20014端口(websocket協(xié)議)
nginx配置類(lèi)似如下:
server {
location /wss/ {
proxy_pass http://127.0.0.1:20014;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
# location / {} 站點(diǎn)的其它配置...
}
第二步:在寶塔中給知識(shí)付費(fèi)站點(diǎn)配置證書(shū),知識(shí)付費(fèi)后臺(tái)基礎(chǔ)配置下的網(wǎng)站網(wǎng)站鏈接改成https;并且網(wǎng)站所有訪問(wèn)鏈接均改成https,包括微信公眾號(hào)菜單等
第四步:使用命令php think workerman status檢查workerman是否開(kāi)啟中,若是開(kāi)啟需要使用命令php think workerman stop 關(guān)閉然后開(kāi)啟workerman;如果關(guān)閉直接開(kāi)啟workerman。
這樣直播使用https就可以實(shí)現(xiàn)了