I can't seem to get nginx to set expires headers on my static assets in my Rails app.
My app is deployed using Phusion Passenger & nginx.
Below is the related section of my nginx config file
server {
listen 80;
server_name my.domain.tld;
root /home/deploy/my.domain.tld/current/public;
passenger_enabled on;
access_log off;
location ~* \.(ico|css|js|gif|jp?g|png)\?[0-9]+$ {
expires max;
break;
}
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html break;
}
}
I'm not sure why its not setting expires headers on my static assets ( e.g. /images/foo.png?123456 )
I'm not sure if it has something to do with passenger or if my location regexp just isnt catching it