From 7f4f46a1e2f0433bf428bc8c3566373a47023d84 Mon Sep 17 00:00:00 2001 From: Jason Staten Date: Mon, 9 Sep 2013 12:12:01 -0600 Subject: [PATCH] Set X-Forwarded-Proto Header Heroku passes the X-Forwarded-Proto header to indicate the protocol of the incoming request[1]. Ruby's rack relies on this header to determine if a request is HTTPS[2]. Also, the X-Scheme header was removed to eliminate redundant passing of the scheme. [1]: https://devcenter.heroku.com/articles/http-routing#heroku-headers [2]: https://github.com/rack/rack/blob/master/lib/rack/request.rb#L77 --- plugins/nginx-vhosts/post-deploy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/nginx-vhosts/post-deploy b/plugins/nginx-vhosts/post-deploy index 29cc35eae..858710309 100755 --- a/plugins/nginx-vhosts/post-deploy +++ b/plugins/nginx-vhosts/post-deploy @@ -46,7 +46,7 @@ server { proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host \$http_host; - proxy_set_header X-Scheme \$scheme; + proxy_set_header X-Forwarded-Proto \$scheme; proxy_set_header X-Forwarded-For \$remote_addr; } } @@ -64,6 +64,7 @@ server { proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host \$http_host; + proxy_set_header X-Forwarded-Proto \$scheme; proxy_set_header X-Forwarded-For \$remote_addr; } }