Opened 3 years ago

Closed 3 years ago

#1052 closed defect (invalid)

Invalid time value var for proxy_cache_valid

Reported by: thimoonxy@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.9.x
Keywords: Invalid time value Cc: thimoon@…
uname -a: Linux centos-sandbox 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: [Win7] ./nginx.exe -V nginx version: nginx/1.10.1 built by cl 16.00.30319.01 for 80x86 built with OpenSSL 1.0.2h 3 May 2016 TLS SNI support enabled configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre-8.38 --with-zlib=objs.msvc8/lib/zlib-1.2.8 --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-openssl=objs.msvc8/lib/openssl-1.0.2h --with-openssl-opt=no-asm --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module --with-ipv6 -----------------------------------------------------------<br> [CentOS7] /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.9.7 built by gcc 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) built with OpenSSL 1.0.2h 3 May 2016 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --add-module=../headers-more-nginx-module-master/ --with-stream --add-module=../ngx_cache_purge-2.3 --with-openssl=../openssl-1.0.2h

Description

Hi Nginx,

It works for 'expires' in the same conf file, So I assume it's a defect just for proxy_cache_valid.

It fails both Win 1.10.1 & linux 1.9.7 on my boxes.

## conf ##

set $test "1m";
proxy_cache_valid $test;

## -t ##

~]# /usr/local/nginx/sbin/nginx -t

nginx: [emerg] invalid time value "$test" in /usr/local/nginx/conf.d/pwrd-dota.conf:20
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

Change History (1)

comment:1 Changed 3 years ago by ru

  • Resolution set to invalid
  • Status changed from new to closed

Not all directives support variables, and http://nginx.org/r/proxy_cache_valid does not. On the contrast, http://nginx.org/r/expires supports variables since 1.7.9.

Note: See TracTickets for help on using tickets.