Opened 7 years ago

Closed 7 years ago

#1461 closed defect (wontfix)

set $arg_param does not work

Reported by: kaynz@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.12.x
Keywords: $args $arg $arg_param set Cc:
uname -a: Linux 4.9.56-1-lts #1 SMP Thu Oct 12 22:34:15 CEST 2017 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.12.2
built with OpenSSL 1.1.0g 2 Nov 2017 (running with OpenSSL 1.1.0f 25 May 2017)
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --user=http --group=http --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --http-client-body-temp-path=/var/lib/nginx/client-body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-cc-opt='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2' --with-ld-opt=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now --with-compat --with-debug --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-stream --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads

Description

Hey all!

Here's my server block with bug/workaround commenting:

server {
    listen 443 ssl http2;
    server_name x.com;

    ssl on;
    ssl_certificate path/fullchain.pem;
    ssl_certificate_key path/privkey.pem;

    location / {
        ### BUG ###
        # set $arg_param value; DOES NOT WORK
        
        ### WORKAROUND ###
        if ($args ~ (.*)&param=oldvalue(.*)) {
            set $args $1$2&param=value # WORKS
        }

        proxy_pass https://remote-url.com/;
        proxy_cache            remote_cache;
        proxy_cache_lock on;
        proxy_cache_revalidate on;
        proxy_cache_valid      200  7d;
        proxy_cache_use_stale  error timeout invalid_header updating http_502 http_503 http_504;
        proxy_hide_header Access-Control-Allow-Origin;
        include conf.d/shared/cors.conf;
    }
}

set &arg_param does not change the value of &param=

Thanks.

Change History (1)

comment:1 by Maxim Dounin, 7 years ago

Resolution: wontfix
Status: newclosed

Yes, and it was never meant to. If I recall correctly, the only variables which are set with side effects are $args and $limit_rate. In all other cases the only effect of set is that the variable value is changed, but not properties the variable is calculated from.

Note: See TracTickets for help on using tickets.