Permalink
Browse files

lower worker processes to make room for jruby on my micro-ec2 instanc…

…e, and forward along cookies sent from upstream proxy
  • Loading branch information...
1 parent 4115752 commit d6f8e24f5e8187e8d6cd1c992b80047c4e5185e4 @diclophis committed Jan 25, 2013
Showing with 5 additions and 2 deletions.
  1. +4 −1 config.ru
  2. +1 −1 rainbows.rb
View
@@ -91,6 +91,8 @@ class Rack::Proxy
sub_request["X-Requested-With"] = req.env['HTTP_X_REQUESTED_WITH'] if req.env['HTTP_X_REQUESTED_WITH']
sub_request["Accept-Encoding"] = req.accept_encoding
sub_request["Referer"] = req.referer
+ sub_request["Host"] = req.host
+ sub_request["Cookie"] = env["HTTP_COOKIE"]
sub_request.basic_auth *uri.userinfo.split(':') if (uri.userinfo && uri.userinfo.index(':'))
sub_response = Net::HTTP.start(uri.host, uri.port) do |http|
@@ -99,7 +101,8 @@ class Rack::Proxy
headers = {}
sub_response.each_header do |k,v|
- headers[k] = v unless k.to_s =~ /cookie|content-length|transfer-encoding/i
+ #headers[k] = v unless k.to_s =~ /cookie|content-length|transfer-encoding/i
+ headers[k] = v unless k.to_s =~ /content-length|transfer-encoding/i
end
[sub_response.code.to_i, headers, [sub_response.read_body]]
View
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
-worker_processes 4
+worker_processes 1
#rewindable_input false
#Rainbows! do

0 comments on commit d6f8e24

Please sign in to comment.