Possibble to use fastcgi cache with set-cookie header

Hi,

I’m wondering if it is possible to force fastcgi_cache even when there
is a Set-Cookie header? I was testing with

http://nginxtest.exotica.org.uk/index.php

which sets

Set-Cookie: site=nginxtest; HttpOnly
Expires: Thu, 19 Nov 1981 00:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache

but I can only cache it with nginx if i remove the Set-Cookie header.

my config.

http {
fastcgi_cache_path /var/cache/nginx levels=1:2
keys_zone=fastcgicache:10M;
}

server {
listen 80;
server_name nginxtest.exotica.org.uk;

root /path/to/website
index index.html index.php;

location ~ .php$ {
fastcgi_cache_valid any 10m;
fastcgi_cache_key $host$request_uri;
fastcgi_ignore_headers Cache-Control Expires;
fastcgi_cache fastcgicache;
fastcgi_pass unix:/somepath/fcgi.sock
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

fastcgi_ignore_headers Cache-Control Expires;

Changing this to

fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

seems to do the job, but this is not documented anywhere I could find
(not on the wiki for example). Is this correct? if so, I’ll add it to
the wiki (and if it is what version was this introduced?)

I’m running nginx 0.8.49 btw.

Best Regards

Jools

2010/8/20 Jools W. [email protected]:

fastcgi_ignore_headers Cache-Control Expires;

Changing this to

fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

seems to do the job, but this is not documented anywhere I could find (not
on the wiki for example). Is this correct?

yes it is. But be careful using this on a site where cookies are used
for authentication and cannot be switch between users.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs