title: InvalidAuthenticityToken in Rails 5 behind Nginx using SSL
body: <p>I've got a really weird issue with Rails 5 (beta1) and it's preventing me from safely submitting any forms.</p>
  
  <p>When running in production mode behind an Nginx (1.4.6 on Ubuntu 12.04) reverse proxy which decrypts SSL, Rails is rejecting my CSRF tokens saying they are invalid despite the fact that the correct token is being submit by the form.</p>
  
  <p>Everything works fine when I turn SSL off in Nginx.</p>
  
  <p>Any help would be appreciated.</p>