当前位置:Gxlcms > PHP教程 > nginx安装nginx_http_push_module

nginx安装nginx_http_push_module

时间:2021-07-01 10:21:17 帮助过:6人阅读

一键安装nginx_http_push_module

cd /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教程有兴趣的朋友有所帮助。

人气教程排行