xingwenge / canal-php

Alibaba mysql database binlog incremental subscription & consumer components Canal's php client[阿里巴巴mysql数据库binlog的增量订阅&消费组件 Canal 的 php 客户端 ] https://github.com/alibaba/canal
384 stars 67 forks source link

只能用命令行运行么?我部署在Nginx下,会报错502错误。 #6

Closed ChenRuihua closed 4 years ago

ChenRuihua commented 4 years ago

如题,可以部署在nginx下么?

xingwenge commented 4 years ago

php-canal 是tcp长连接,nginx web是tcp短连接,浏览器用户超过了连接时间,会关闭浏览器客户端连接,所以502了。 如果要在nginx里,需把tcp连接超时时间取消,用flush()刷新输出浏览器页面,应该就可以放到nginx里了

feng99 commented 3 years ago

php cli模式启动更合理 放到nginx里不合理