On Fri, 2006-06-23 at 05:57 -0700, Scott Walter wrote:> Hi,
>
> I don''t know if this question should be posted here on the Rails
list
> or the Mongrel list, but I''ll try here first. I had been using
> Aapache+FCGI and when I run the following code from my server''s
domain
> "perficient.com" it returns "perficient.com:80":
>
> port = @request.env["SERVER_PORT"]==''80'' ?
'''' :
> ":#{@request.env["SERVER_PORT"]}"
> server = "http://#{@request.env["SERVER_NAME"]}#{port}"
>
> however when I use Apache+Mongrel it returns "localhost:3000".
>
>
> Any ideas? if not is there another method I could call to get the
> true server domain and port that the original request came to?
Depends, if you just want to get the host:port that the client thinks
it''s connecting to then you''ll want to use "HOST".
If you need the
host:port that Mongrel is running on for some kind admin thing then
it''s running on localhost:3000 and there''s not a whole that
can be
done unless you change the port and address on the command line (do
mongrel_rails start -h).
--
Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/