当前位置:首页 > 服务器技术 > nginx

nginx安装nginx_http_push_module

一键安装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;
}

测试如下 左侧变成长连接了

nginx安装nginx_http_push_module - 文章图片

点击send按钮后

nginx安装nginx_http_push_module - 文章图片

以上就介绍了nginx 安装 nginx_http_push_module,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!