So I\'ve looked at every sample configuration I could find and yet every time I try and view a page that requires ssl, I end up in an redirect loop. I\'m running nginx/0.8.5
X_FORWARDED_PROTO as in your file can cause errors and it did in my case. X-Forwarded-Proto is correct whereas the hiphens are more important than uppercase or lowercase letters.
You can avoid those problems by sticking to conventions ;)
see also here: Custom HTTP headers : naming conventions and here: http://www.ietf.org/rfc/rfc2047.txt