Forum: Ruby on Rails RoR, lighttpd, and localhost

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Belorion (Guest)
on 2006-04-18 23:18
(Received via mailing list)
This is really more of a web server configuration question, but it
seemed
like a problem in which RoR'ers would be well versed.

I am running a RoR app on lighttpd behind an Apache proxy (well, reverse
proxy is perhaps more accurate).

Since the requests are being proxied to Lighttpd from the same server,
my
Rails apps think that the requests are coming from localhost.  As such,
anytime an error is encountered in the Rails app, I get the "development
mode" style verbose errors, instead of the production friendly ones.

Does anyone know how to fix this? I have preserve host headers turned
on,
which I thought would've fixed it, but it does not.  Ideally this would
be a
fix on the web server side as I am also experiencing a similar problem
with
a PHP app running on the same lighttpd server, but I'll take anything I
can
get.  Any suggestions?

Matt
Bryan D. (Guest)
on 2006-04-19 01:37
Belorion wrote:
> This is really more of a web server configuration question, but it
> seemed
> like a problem in which RoR'ers would be well versed.
>
> I am running a RoR app on lighttpd behind an Apache proxy (well, reverse
> proxy is perhaps more accurate).
>
> Since the requests are being proxied to Lighttpd from the same server,
> my
> Rails apps think that the requests are coming from localhost.  As such,
> anytime an error is encountered in the Rails app, I get the "development
> mode" style verbose errors, instead of the production friendly ones.
>
> Does anyone know how to fix this? I have preserve host headers turned
> on,
> which I thought would've fixed it, but it does not.  Ideally this would
> be a
> fix on the web server side as I am also experiencing a similar problem
> with
> a PHP app running on the same lighttpd server, but I'll take anything I
> can
> get.  Any suggestions?
>
> Matt

I think that when I set up my Apache proxy for my textdrive account,
instead of forwarding to localhost:other_port it worked better if you
forward to yourdomain.com:other_port.

Also, are you sure that its giving you these errors because of host
issues, and not because you're in development mode rather than
production?
Belorion (Guest)
on 2006-04-19 20:24
(Received via mailing list)
>
> I think that when I set up my Apache proxy for my textdrive account,
> instead of forwarding to localhost:other_port it worked better if you
> forward to yourdomain.com:other_port.


It depends on how you define "works better".  The problem with setting
the
proxy for yourdomain.com:otherport is that Apache then has to do a DNS
lookup.  This seems to cause severe response delays (at least last time
I
tried it).


Also, are you sure that its giving you these errors because of host
> issues, and not because you're in development mode rather than
> production?


Well, I have it set to production mode in my config/environment.rb ...
so
unless something changed in 1.1 I assume this is where it is getting
set.

-Matt
This topic is locked and can not be replied to.