This is a good technique to know. I feel like that cookie should be HTTP only though. It looks like nginx doesn't support that out of the box.
Seems like it wouldn't be too terribly hard to add to nginx...hmm... ;)
BTW, rails signed session cookies are terrible from a security perspective. Thank god Github has moved away from them.