Welcome! Log In Create A New Profile

Advanced

Re: Disable proxy buffering for websockets

Maxim Dounin
December 16, 2018 09:28PM
Hello!

On Sun, Dec 16, 2018 at 02:45:56PM -0800, Chad Phillips wrote:

> I use software that runs a speed test via websockets. When proxying this
> websocket connection through Nginx, the 'download' portion of the test is
> inaccurate.
>
> My theory is that this is due to Nginx buffering the response from the
> backend server, thus the timer on the backend server reports an inaccurate
> value compared to when it's not proxied.
>
> I've tried the following settings at both the location and server levels of
> my configuration:
>
> proxy_buffering off;
> proxy_ignore_headers X-Accel-Buffering;
>
> However, this doesn't fix the problem. I've confirmed the functionality
> works correctly when it's not being proxied via Nginx, so wondering if A)
> there is some other cause of the issue besides the proxy buffer, or B) I'm
> not using the proxy buffer settings correctly?

As long as a connection is upgraded to the websockets protocol,
buffering doesn't matter: regardless of the settings nginx will
proxy anything without buffering.

Note though that websockets proxying requires special
configuration, see here:

http://nginx.org/en/docs/http/websocket.html

Note well that proxying though nginx implies several additional
buffers being used anyway (two socket buffers and a proxy buffer
within nginx), and this may reduce accuracy.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Disable proxy buffering for websockets

Chad Phillips December 16, 2018 05:48PM

Re: Disable proxy buffering for websockets

Maxim Dounin December 16, 2018 09:28PM

Re: Disable proxy buffering for websockets

thehunmonkgroup December 18, 2018 11:58AM

Re: Disable proxy buffering for websockets

Maxim Dounin December 18, 2018 01:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready