0

I'm using nginx to serve a sinatra based project which has fairly static content..

I've tried to combine this: http://articles.slicehost.com/2008/5/27/ubuntu-hardy-nginx-rails-and-thin

with the proxying solution offered elsewhere on this site: How to set up Nginx as a caching reverse proxy?

Coming up with...

https://gist.github.com/1167754

But for some reason, nothing is ever written to cache. I've made sure nginx owns the folder used for caching, and there are no errors in the error.log..

Apologies for the semi-reproduced content, but I couldn't find a good guide to combining the two.

1 Answer 1

0

"Set-Cookie"

Nginx version 0.8.44+ does not cache upstream responses with Set-Cookie header. Make sure your backend does not issue it.

"If"

"If is Evil", rewrite your config to smth like

location / {
  # ...
}

location ~ \.(ico|css|js|gif|jpe?g|png)$ {
  expires max;
}

Locations match a path, not arguments. That's why I omitted the last part of your regular expression that was supposed to match a query string.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .