Problem with variables in the proxy definition?

Hi, have come across a problem with using variables. Can anyone confirm
this is a bug?

For my rails app I reverse proxy to mongrel and this works ok:

  if (!-f $request_filename) {
    proxy_pass http://mongrel_cluster;

But this does not:

set $cluster  "mongrel_cluster"
  if (!-f $request_filename) {
    proxy_pass http://$cluster;

In fact it passes it to the correct mongrel, but mongrel then complains
with error (anonymised a bit):

09/04/2008 21:16: HTTP parse error, malformed request (
#<Mongrel::HttpParserError: Invalid HTTP format, parsing fails.>
09/04/2008 21:16: REQUEST DATA: "GET HTTP/1.0\r\nX-Real-IP:\r\nX-Forwarded-For:\r\nHost:\r\nConnection: close\r\nUser-Agent: Mozilla/5.0
(Macintosh; U; Intel Mac OS X; en-US; rv: Gecko/20080311

en-us,en;q=0.5\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nReferer:\r\nCookie: __utma=253725333.183964;

__utmc=25372533; _session_id=88aaaaaaaa21213ef1;
auth_token=f3aaaaaaaaaa5eb78\r\nCache-Control: max-age=0\r\n\r\n"

Can anyone help work around this (would simplify my configs a lot to be
able to make this work?


Ed W

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs