Actually, the problem was bit different. The last element of the response array should be an array too.
wrong:
[307, { "Location" => "http://production.example.com" + env["PATH_INFO"] }, ""]
good:
[307, { "Location" => "http://production.example.com" + env["PATH_INFO"] }, []]