前提: 假设有A、B两台服务器,且保证A、B之间内网7443端口互通。
一 freeswitch证书问题:(A服务器)
freeswitch 路径: /usr/local/freeswitch/certs
注意:certs目录下会存在:wss.pem一个文件 (此文件要和你B服务器nginx证书保持一致)
二:wss配置(B服务器)
注意:wss配置 nginx代理需要注意:proxy_pass https
upstream wss-service {
server xxx.xxx.xxx.xxx:7443;
}
server {
listen 443 ssl; # 监听9000端口
server_name xxx.xxx.xxx.xxx;
ssl_certificate /data/nginx/xxx.crt;
ssl_certificate_key /data/nginx/xxx.key;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
ssl_verify_client off;
add_header Access-Control-Allow-Origin *;
location / {
#添加wensocket代理
proxy_pass https://wss-service; # websocket服务器。不用管 ws://
# proxy_pass http://xxx.xxx.xxx.xxx:7443; # websocket服务器。不用管 ws://
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
}
}
三:验证是否配置成功
wscat -c wss://域名地址
不要问wscat命令没有怎么办,自己想办法,实现不行就去浏览器找wss在线测试工具
瑞思拜!!!



