GatewayWoker+Yii+Nginx+微信小程序聊天

主要参考文献

http://doc.workerman.net/install/install.html

1、安装环境检测

curl -Ss http://www.workerman.net/check.php | php

上面脚本如果全部显示ok,则代表满足WorkerMan要求

否则要安装pcntl和posix扩展

yum install php-process

如版本冲突可查看当前版本后缀例 (yum install php56w-process)

2、Windows试玩

下载并配置php变量 https://www.workerman.net/windows

开启Telenet 服务https://jingyan.baidu.com/article/3c343ff709cbe40d377963d4.html

GatewayWoker+Yii+Nginx+微信小程序聊天_第1张图片

3、Linux试玩

GatewayWoker+Yii+Nginx+微信小程序聊天_第2张图片

4、Nginx服务器反向代理配置,转发给服务器本地Wss

https://wenda.workerman.net/question/2388

https://blog.csdn.net/qq_35808136/article/details/89677749

server

{

    listen 443 ssl;

    server_name 域名;

    ssl on;

    ssl_certificate 证书.crt;

    ssl_certificate_key 证书.key;

    ssl_session_timeout 5m;

    ssl_session_cache shared:SSL:50m;

    ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置

    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;

    ssl_prefer_server_ciphers on;


    location /wss/  { 

    proxy_pass http://127.0.0.1:82/;        #通过配置端口指向部署websocker的项目

    proxy_http_version 1.1;   

    proxy_set_header Upgrade $http_upgrade;   

    proxy_set_header Connection "Upgrade";   

    proxy_set_header X-real-ip $remote_addr;

    proxy_set_header X-Forwarded-For $remote_addr;

    }

}

小程序内可通过URL:wss://域名/wss/  访问

5、

你可能感兴趣的:(GatewayWoker+Yii+Nginx+微信小程序聊天)