atom feed3 messages in ru.sysoev.nginxExpires header - with variable value ...
FromSent OnAttachments
Rob DupuisAug 11, 2008 11:56 am 
Igor SysoevAug 12, 2008 12:26 am 
Rob DupuisAug 12, 2008 2:49 am 
Subject:Expires header - with variable value or without break
From:Rob Dupuis (list@public.gmane.org)
Date:Aug 11, 2008 11:56:46 am
List:ru.sysoev.nginx

Hi.

I'm trying to sort out expires headers for my rails app.

I'm trying two approaches, neither of which seem to work:

---------- Approach 1 - (simple expires in if block):

location / {

if ( $request_uri ~* \.(css|js|gif|jpe?g|png|ico|htc)\?ts_ ) { expires max; }

if (-f $request_filename) { break; }

proxy_pass http://app_servers; }

This doesn't work at all unless I put a break; within the if block (same problem as: http://www.ruby-forum.com/topic/129953)

---------- Approach 2 - (set expires variable into a variable):

location / { set $expires_value -1;

if ( $request_uri ~* \.(css|js|gif|jpe?g|png|ico|htc)\?ts_ ) { set $expires_value max; }

if (-f $request_filename) { expires $expires_value; break; }

proxy_pass http://app_servers; expires $expires_value; break; }

This gives me an emerg message: "expires" directive invalid value in conf_file

Can anyone help with this? Thanks, Rob