LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [nginx] stop nginx from buffering uptream (https://www.linuxquestions.org/questions/linux-software-2/%5Bnginx%5D-stop-nginx-from-buffering-uptream-4175593064/)

hilou 11-06-2016 11:43 PM

[nginx] stop nginx from buffering uptream
 
Hi All,

I meet a nginx buffering issue. Here is the details:

Nginx is used to proxy flv play to backend stream service, I want to stop nginx from buffering upstream streams. I have the proxy_buffering off config, but it didn't work. When the network is really bad, the playing through nginx is continued without dropping frames which is not what expected. But when play directly through backend stream service, all look good.

What's expected:
When the client(player) has a poor network connection, it should follow up the live stream by droping frames instead of being delayed. The dropping is done by the backend stream service which listen on port 1234, and nginx proxy 80 to 1234 to play.

Here is my nginx configuration:

nginx version: 1.4.4

Code:

server {
        listen      80 ;
        server_name www.example.com;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_redirect off;

        proxy_buffering off;
        proxy_max_temp_file_size 0;

        location ~ \.flv$ {
                proxy_pass http://127.0.0.1:1234;
                access_log logs/flv.alog;
                error_log  logs/flv.elog debug;
                break;
        }
}



All times are GMT -5. The time now is 12:29 PM.