Forum: Ruby on Rails Hide port 16080 after redirect

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.
cynthia.kiser (Guest)
on 2005-12-01 09:45
(Received via mailing list)
I have a couple of sites running on a Mac OsX server using fcgi
(Apache 1.3 on Panther). Works fine until my app creates a redirect
(for example: after create, redirect to list). Then the url of my name
based virtual host shows :16080. I found a good explanation of port
16080, virtual hosting, and web performance caching on
http://docs.info.apple.com/article.html?artnum=106407 They even
mention potential oddness after redirects - but don't say how to fix
it. Is there something I can do in my apache or (more likely) in my
rails configuration that will hide the pesky port number from end
users? Perhaps something that sets a canonical url for the app?

--
Cynthia K.
removed_email_address@domain.invalid
ezra (Guest)
on 2005-12-01 18:34
(Received via mailing list)
On Nov 30, 2005, at 11:42 PM, Cynthia K. wrote:

>
> --
>
> Cynthia K.
> removed_email_address@domain.invalid
>

Cynthia-

	Here is an apache vhost that you can use to proxy to webrick or
lighttpd on a higher port that will keep the port number hidden. I am
assuming you are running webrick(script/server) for your actual rails
app and just using apache in front to be on port 80?


<VirtualHost *:80>
     ServerName example.com
     ServerAlias www.example.com
     ProxyPass / http://example.com:8000/
     ProxyPassReverse / http://example.com:8000/
</VirtualHost>


Change example.com to your site's name and change 8000 to the port
you are running your rails app on and you should be good to go!


Cheers-

-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid
This topic is locked and can not be replied to.