Problem with devise and nginx proxy cache

I have a RoR project which was working just fine.
But i’ve tryied to follow this site and add proxy cache to my nginx
config: and
just won’t sign_in anymore. I don’t get any errors, just don’t sign_in
redirect me to login again.

As the autor from the link suggested to someone with same problem as I,
done this on my nginx conf:

location = /users/sign_in{
proxy_pass http://app;
proxy_set_header Host $http_host;
proxy_ignore_headers Set-Cookie;
proxy_ignore_headers Cache-Control;
proxy_cache_bypass $http_secret_header;
add_header X-Cache-Status $upstream_cache_status;

The same to /login.
But devise still won’t sign_in.

Anyone knows how to solve that?
Any more configs so I can skip cache to sign_in?

Posted at Nginx Forum:,260188,260188#msg-260188