一键安装nginx_http_push_modulecd /opt/ && wget https://github.com/slact/nginx_http_push_module/archive/master.zip && unzip master.zip && cd (/opt/nginx-master | 替换成你的ngnix源码目录) && ./configure --add-module=/opt/nginx_http_push_module-master
nginx.conf 中添加
location /pub {
push_publisher;
set $push_channel_id $arg_id;
push_store_messages off;
}
location /sub {
push_subscriber;
set $push_channel_id $arg_id;
}
测试如下 左侧变成长连接了
点击send按钮后
以上就介绍了nginx 安装 nginx_http_push_module,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
本文原创发布php中文网,转载请注明出处,感谢您的尊重!