Welcome! Log In Create A New Profile


Re: control proxy_buffering with variables

Maxim Dounin
November 17, 2023 03:32PM

On Fri, Nov 17, 2023 at 03:57:23AM +0000, public1020 via nginx wrote:

> I'm trying to control buffering with variables, but nginx complains about it,
> nginx: [emerg] invalid value "$val" in "proxy_request_buffering" directive, it must be "on" or "off" in /etc/nginx/sites-enabled/test.conf:9
> Is there any way to resolve this? Attached the configuration in question.

Much like most of the nginx configuration directives,
"proxy_request_buffering" does not support variables. Note that
if variables are supported by a particular directive, this is
explicitly documented in the directive description at nginx.org.

If you want to use different buffering options for different
requests, consider using distinct locations instead. Something

location / {

location ~* enable {
proxy_request_buffering off;
proxy_buffering off;

would be close to the configuration you've tried to use, and
mostly arbitrary conditions, including the exact equivalent to
your configuration, can be implemented using internal
redirections, such as with "rewrite".

Note well that the proxy_buffering can also be controlled from the
backend via the X-Accel-Buffering response header.

Maxim Dounin
nginx mailing list
Subject Author Posted

Re: control proxy_buffering with variables

Maxim Dounin November 17, 2023 03:32PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 200
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