Problem with redirect_to() and VirtualHost

I’m running into a problem with redirect_to() and Apache’s
VirtualHost facility. I have probably have something set up
wrong, but I’m not even sure how to approach the problem.


We have DNS set up to return the domain’s address for all
sub-domains. So, “dig” returns the same IP
address as “dig”.

Our router forwards ranges of port numbers to specified
machines. So, a request on port 1234 might go to “fido”.

We are using Apache’s VirtualHost facility to redirect (?)
requests to certain machines, as:

<VirtualHost *:80>
  ServerAdmin       [email protected]
  ErrorLog          /dev/null
  CustomLog         /dev/null common
  ProxyRequests     Off
  ProxyPass         /
  ProxyPassReverse  /

As a result, requests to are answered
by a Rails server that is set up to answer port 1234 on This (mostly) works fine, both inside and
outside of the LAN.


If a user enters an invalid value into a form, we want to
set up the “flash” hash and redirect back to the page that
contained the form. Something like:

flash[:notice] =  get_errors()

This works (on the LAN) when the URL of the form page is:

However, if the URL is:

the redirect results in:

Proxy Error

The proxy server received an invalid response from an
upstream server.

The proxy server could not handle the request POST

Reason: Document contains no data

The server says:

[2007-06-21 14:18:42] ERROR URI::InvalidURIError:
the scheme http does not accept registry part: (or bad hostname?)
/usr/local/lib/ruby/1.8/uri/generic.rb:729:in `merge'

Any ideas on what might be wrong or (better) how to fix it?

-r Rich M. [email protected] +1 650-873-7841

Technical editing and writing, programming, and web development