This allows backend application servers to set "rack.url_scheme"
as appropriate using Rack::Request#scheme.

Plack/PSGI users can also take advantage of this using
Plack::Middleware::ReverseProxy
---
  Eric Wong <[email protected]> wrote:
  > Things like rack.url_scheme, SERVER_NAME, SERVER_PORT, etc...
  > will all need to be set properly.

 lib/yahns/proxy_pass.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb
index 3b68f01..511db02 100644
--- a/lib/yahns/proxy_pass.rb
+++ b/lib/yahns/proxy_pass.rb
@@ -226,6 +226,7 @@ def call(env)
     end
 
     req = "#{env['REQUEST_METHOD']} #{req} #{ver}\r\n" \
+          "X-Forwarded-Proto: #{env['rack.url_scheme']}\r\n" \
           "X-Forwarded-For: #{env["REMOTE_ADDR"]}\r\n".dup
 
     # pass most HTTP_* headers through as-is
-- 
EW

--
unsubscribe: [email protected]
archive: http://yhbt.net/yahns-public/

Reply via email to