Welcome! Log In Create A New Profile

Advanced

Re: bug with X-Accel-Expires 0 ?

Jérôme Loyet
February 26, 2010 07:44AM
Has my mail been marked as spam ? :)

Le 19 février 2010 10:15, Jérôme Loyet <jerome@loyet.net> a écrit :
> Hi igor,
>
> I've made a patch for this bug. What do you think ?
>
> ++ jerome
>
> Le 18 février 2010 11:48, Jérôme Loyet <jerome@loyet.net> a écrit :
>> Hi,
>>
>> I have a strange behaviour, I think it's a bug.
>>
>> I have set nginx as a frontend to apache using proxy_pass. I also set
>> up proxy_cache to cache everyhting from the proxy:
>>
>> log_format my_combined '$remote_addr - $remote_user [$time_local]
>> "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"
>> $request_time $upstream_cache_status';
>> server {
>>  ...
>>  access_log /var/log/nginx/access my_combined;
>>  proxy_cache cache1;
>>
>>  location / {
>>    proxy_cache_valid any 5m;
>>    proxy_pass http://backend.www;
>>  }
>> }
>>
>> To exclude some pages from being cached, I'm adding the
>> "X-Accel-Expires: 0" in the response from the backend.It works as
>> those pages are marked as MISS in the access log (MISS and HIT when
>> X-Accel-Expires is not set).
>>
>> But, when the page is not cached (with X-Accel-Expires) some headers
>> are hidden as if the page was cached.
>>
>>
>> Here is some example:
>>
>> The backend set these headers:
>>
>> Set-Cookie: PHPSESSID=bd01a429e06336b883d36d6633a04917; path=/
>> Content-Length: 11
>>
>> The client receives:
>> Content-Length: 11
>>
>> As the page is cached, the Set-Cookie header is removed.
>>
>> Then if the backend add the X-Accel-Expires header:
>>
>> Set-Cookie: PHPSESSID=bd01a429e06336b883d36d6633a04917; path=/
>> Content-Length: 11
>> X-Accel-Expires: 0
>>
>> The clients receives:
>> Content-Length: 11
>>
>>
>> The page is not cached (thanks to X-Accel-Expires: 0) but the
>> Set-Cookie headers has been removed without any reasons.
>>
>> This bug exists because the list of headers to remove are set when the
>> conf is loaded (ngx_http_proxy_merge_loc_conf in
>> http/modules/ngx_http_proxy_module.c at line 2256) and it should be
>> done dynamicaly for each requests.
>>
>

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Re: bug with X-Accel-Expires 0 ?

Jérôme Loyet 3507 February 26, 2010 07:44AM

Re: bug with X-Accel-Expires 0 ?

Maxim Dounin 1329 February 26, 2010 08:48AM

Re: bug with X-Accel-Expires 0 ?

Jérôme Loyet 1275 February 26, 2010 09:16AM

Re: bug with X-Accel-Expires 0 ?

Maxim Dounin 1347 February 26, 2010 09:52AM

Re: bug with X-Accel-Expires 0 ? Attachments

Jérôme Loyet 1200 June 09, 2010 06:06PM

Re: bug with X-Accel-Expires 0 ?

Jérôme Loyet 1046 June 30, 2010 11:22AM

Re: bug with X-Accel-Expires 0 ?

Maxim Dounin 1125 July 01, 2010 12:36AM

Re: bug with X-Accel-Expires 0 ?

Jérôme Loyet 1058 July 01, 2010 02:08AM

Re: bug with X-Accel-Expires 0 ?

Igor Sysoev 1479 July 01, 2010 02:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 151
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready