尝试通过 nginx/fastcgi 使用 eventsource 进行流式传输
我正在尝试使用 MVC.NET、Nginx 和 Fastcgi 设置事件流。使用 xsp4 的流媒体工作正常,但我无法通过 Nginx 和 Fastcgi 使其工作。我的目标是打开 EventSource 流并将下游数据传输到我的网站。
我尝试添加“ngx_http_upstream_keepalive”模块 - http://wiki.nginx.org/HttpUpstreamKeepaliveModule - 这很有趣,因为有模块描述中的“注意 - 这不适用于 HTTP 上游”。但是等等,这不是模块的名称吗?无论如何,也许我在这里很困惑。我还尝试将“proxy_buffering off”添加到我的 nginx.conf 中,但这也没有帮助。
我知道这应该很容易做到,但我不知所措。我可以在 nginx.conf 中添加一些属性来使其工作吗?或者是否需要在.NET 的响应中添加一些内容?
请帮助我 StackOverflow!
I am trying to set up an event stream using MVC.NET, Nginx and Fastcgi. The streaming works fine for me using xsp4, but I have not been able to get it to work through Nginx and Fastcgi. My goal is to open an EventSource stream and to downstream data to my website.
I have tried adding the 'ngx_http_upstream_keepalive' module - http://wiki.nginx.org/HttpUpstreamKeepaliveModule - which is funny because there is "Note - this This will not work with HTTP upstreams" in the module description. But wait, isn't that the name of the module? Anyways, maybe I'm confused here. I have also tried adding 'proxy_buffering off' to my nginx.conf, which also hasn't helped.
I understand this should be fairly easy to do, but I am at a loss. Is there some property I can add to my nginx.conf to make this work? Or is there something to add to the Response in .NET?
Please help me StackOverflow!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我在这里读到的内容:
http://wiki.nginx.org/X-accel
您需要关闭X-加速缓冲。这是一些示例代码:
希望上面的代码可以解决您的问题。
Based on what I have read here:
http://wiki.nginx.org/X-accel
you need to turn off X-Accel-Buffering. Here is some example code:
Hopefully the code above fixes your problem.