redirect app
I currently work on port 80, but coworkers work on port 3000. So the urls they send often do not work. I created an app that bounces all local 3000 requests to port 80.
mkdir -p bounce/public bounce/tmp
cd bounce
created config.ru:
app = proc do |env|
url="http://#{env['SERVER_NAME']}#{env['REQUEST_URI']}"
return [302, { "Content-Type" => "text/html", "Location" => url }, "try <a href=\"#{url}\">#{url}</a>" ]
end
run app
enabled port 3000 in /private/etc/apache2/httpd.conf:
Listen 3000
added entry to passenger pref pane. But it didn’t create the proper vhosts entry. I changed port 80 to 3000
<VirtualHost *:3000>
ServerName site1.local:3000
ServerAlias test.local:3000
DocumentRoot "/Users/kbrock/projects/bounce/public"
RackEnv development
<directory "/Users/kbrock/projects/bounce/public">
Order allow,deny
Allow from all
</directory>
</VirtualHost>
All is working.