Welcome! Log In Create A New Profile

Advanced

Re: control proxy_buffering with variables

Maxim Dounin
November 17, 2023 03:32PM
Hello!

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
like

location / {
proxy_pass http://127.0.0.1:3333;
}

location ~* enable {
proxy_pass http://127.0.0.1:3333;
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
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
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: 215
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready