I'm hosting two applications on my web server, one is a Drupal site, and the other is an Errbit installation, which is a Ruby on Rails application. The URLs looks something like this:


I want to drop the need for :3000 on the second URL, so we can access it directly via:


I don't want to redirect, I want the URL to remain, without the port number. I've previously used the following command line commands to set some IP table reconfiguration:

sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000 
sudo iptables -t nat -I OUTPUT -p tcp -d --dport 80 -j REDIRECT --to-ports 3000

...which worked fine, as there was no Apache running on the old server. However, this will cause ALL requests on port 80 to be redirected to port 3000, meaning it will break access to http://ourcompany.com

How do I set this up?

Is there a way to configure the IP tables to allow this, or would this be done in the Apache2 configuration?

1 Answer 1

<VirtualHost *:80>
ServerName errbit.ourcompany.com
ProxyPreserveHost On
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.