control proxy_buffering with variables

public1020 public1020 at proton.me
Fri Nov 17 03:57:23 UTC 2023


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.

server {
listen 8888;
set $val on;

if ($request_uri ~* "enable") {
set $val off;
}

proxy_request_buffering $val;
proxy_buffering $val;

location / {
proxy_pass http://127.0.0.1:3333;
}}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20231117/b8f194d9/attachment.htm>


More information about the nginx mailing list