Opened 12 years ago

Last modified 8 years ago

#146 new enhancement

Age header for proxy_http_version 1.1

Reported by: Christian Bönning Owned by: somebody
Priority: minor Milestone:
Component: nginx-core Version: 1.1.x
Keywords: Cc:
uname -a: Linux fe01 3.0.0-16-generic-pae #29-Ubuntu SMP Tue Feb 14 13:56:31 UTC 2012 i686 i686 i386 GNU/Linux
nginx -V: nginx version: nginx/1.1.18
built by gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --user=www-data --group=www-data --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --without-http_uwsgi_module --without-http_scgi_module --without-http_memcached_module --without-http_ssi_module --without-http_autoindex_module --with-http_addition_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --add-module=/usr/src/nginx/modules/git/nginx-upstream-fair/ --add-module=/usr/src/nginx/modules/git/nginx-headers-more/

Description

As far as I understand RFC 2616 a HTTP 1.1 proxy server must send an 'Age' header for responses generated from its own cache (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.6). However nginx 1.1.18 seems not to send this header in case it sends a reply generated from its cache and 'proxy_http_version' is set to '1.1'.

Change History (4)

comment:1 by Nate Haug, 12 years ago

I'd love to see an Age header in nginx by default. The Age header is the most helpful header for me when working in Varnish configurations and I miss it when working in nginx. Surely there's a way to temporarily provide this header through an nginx add_header, but it's eluding me currently.

comment:2 by Christian Bönning, 12 years ago

I agree with Nate. I'm using Varnish currently and rely on the Age header for debugging purposes. I'm in the process of moving to nginx as my frontend lb/proxy/cache. It sort of blocks the progress of that transition.

Any chance to may be get an ETA for a patch or getting a denial for this feature from one of the developers? I don't know much about C development, but could imaging that it should not be too hard to introduce a new variable (e.g. $upstream_cache_age) for an object to be set using 'add_header Age $var' within the proxy configuration.

comment:3 by Cícero Verneck, 11 years ago

Me too.

I'd love to see an Age header in nginx by default. The Age header is the most helpful header for me when working in Varnish
configurations and I miss it when working in nginx.

Is there any prediction?

comment:4 by Maxim Dounin, 8 years ago

sensitive: 0
Type: defectenhancement
Note: See TracTickets for help on using tickets.