WebRTC搭建流程(一) 准备工作
准备工作
工具准备
- 阿里云购买linux ubuntu_14_04 64位服务器 阿里云地址
- 购买域名,并绑定自己的阿里云服务器外网ip,证书申请等(百度一下)
- 在服务器安装nginx并配置域名证书(百度一下)
- shell连接工具 windows系统安装XShell,mac下安装finalShell,配置阿里云服务器连接。
阿里云服务器端口开放
所有需要开放的端口如下,内网入方向和内网出方向都需要添加如下端口开放
nginx转发配置nginx.conf
-在 # HTTPS server 这一行后面添加转发规则
server {
#listen 80;
listen 443;
server_name 域名;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/cert-1541743822592_xueqingxue.cn.crt;
ssl_certificate_key cert/cert-1541743822592_xueqingxue.cn.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
location ~ {
proxy_pass http://服务器外网地址:8080;
#include proxy.conf;
}
location /wss/
{
proxy_pass http://服务器外网地址:8089;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
rewrite /wss/(.*) /$1 break;
proxy_redirect off;
}
}
ssl_certificate cert/cert-1541743822592_xueqingxue.cn.crt;
ssl_certificate_key cert/cert-1541743822592_xueqingxue.cn.key;
这两个是我自己的证书文件,需要替换成自己的
server_name 域名;
需要换成自己的域名
还没有评论,来说两句吧...