bug with X-Accel-Expires 0 ?

Jérôme Loyet jerome at loyet.net
Thu Jun 10 02:04:30 MSD 2010


2010/2/26 Maxim Dounin <mdounin at mdounin.ru>:
> Hello!
>
> On Fri, Feb 26, 2010 at 03:14:33PM +0100, Jérôme Loyet wrote:
>
>> 2010/2/26 Maxim Dounin <mdounin at mdounin.ru>:
>> > Hello!
>> >
>> > On Fri, Feb 26, 2010 at 01:42:02PM +0100, Jérôme Loyet wrote:
>> >
>> >> Has my mail been marked as spam ? :)
>> >
>> > Not really.  But:
>> >
>> > 1. It's not really a bug, it's more or less feature.  Most likely
>> > it's good idea to change this one day, but see (2).
>> >
>> > 2. Patch looks bad even for me.
>>
>> why do you say that ? I did it quickly but it works as I used it in my
>> production env. It may be just a base to work on.
>
> I believe it works for you and even not coredumps as you are
> lucky.  ;-)
>
> But it at least doesn't follow style and does some wrong things
> like ngx_strncasecmp without checking length first, and unwise
> things like strcmp instead of hash find.
>
> This basically means that someone should rewrite it before it may
> be applied.  Keeping in mind (1) this may not happen too soon.

I maxim

I spent some time to rewrite my previous patch to make it better (at
least I think and I hope).

I added two directives for each upstream (proxy, fastcgi and uwsgi)
which is called

fastcgi_hide_cache_header (the alter ego of fastcgi_hide_header).
fastcgi_pass_cache_header (the alter ego of fastcgi_pass_header).

proxy_hide_cache_header (the alter ego of proxy_hide_header).
proxy_pass_cache_header (the alter ego of proxy_pass_header).

uwsgi_hide_cache_header (the alter ego of uwsgi_hide_header).
uwsgi_pass_cache_header (the alter ego of uwsgi_pass_header).


(fastcgi_hide_headers - fastcgi_pass_headers) hides headers no matter
if the request is cacheable.
(fastcgi_hide_cache_header - fastcgi_pass_cache_header) hides headers
only if the request is cacheable.


The default headers for fastcgi_hide_headers are:
    ngx_string("Status"),
    ngx_string("X-Accel-Expires"),
    ngx_string("X-Accel-Redirect"),
    ngx_string("X-Accel-Limit-Rate"),
    ngx_string("X-Accel-Buffering"),
    ngx_string("X-Accel-Charset"),

The default headers for facstcgi_hide_cache_headers are:
    ngx_string("Set-Cookie"),
    ngx_string("P3P"),

I hope this patch is better than the previous one. I tried to stay in
the nginx philosophy. I hope I succedeed.

++ Jerome
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx.bug.x-accel-expires-v2.patch
Type: application/octet-stream
Size: 17426 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20100610/83197725/attachment-0001.obj>


More information about the nginx-devel mailing list