title: Apache2 ProxyPass for Rails App Gitlab
body: <p>I am attempting to setup a proxy with Apache2 so that incoming requests to <strong>http://myipaddress.com</strong> go to <code>http://localhost:3000/</code> where I have Gitlab ( a rails app ) running. The following is what I have in my Apache configuration file on Ubuntu 10.04. I can successfully access the gitlab default page initially, but any subsequent requests performed by me by clicking on other pages after that go to a 404 NOT FOUND page. I can manually enter /gitlab/ in front of any of these failed redirects and they work just fine. How can I make this work without having to rewrite /gitlab/ after each redirect request after the initial request?</p>
  
  <pre><code>## Setup a proxy which listens on the port that gitlabh does ( from start_server.sh )
  ProxyRequests Off
  ProxyPass /gitlab/ http://localhost:3000/
  ProxyPassReverse /gitlab/ http://localhost:3000/
  #DocumentRoot /home/gitlabhq/gitlabhq/public
  &lt;Proxy http://localhost:3000/&gt;
    Order deny,allow
    Allow from all
  &lt;/Proxy&gt;
  </code></pre>
  
  <p>I understand that I could have the code below , which would solve my problem. But I don't know how to modify the prefix of the gitlab rails service. I'd really appreciate some help!</p>
  
  <pre><code>ProxyPass /gitlab/ http://localhost:3000/gitlab/
  ProxyPassReverse /gitlab/ http://localhost:3000/gitlab/
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Thanks to Friek's comment I've come very close to solving this. Below is part of my http.conf file. The only problem is when I hit the home button or the logo on the gitlab app it attempts to redirect to gitlab/ which gives me the basic index.html file from Apache2 saying 'it works!'. How can I configure this to allow me to simply got /gitlab and it takes me to the root home view of gitlab?? Thanks!</p>
  
  <pre><code>## For Gitlab using Apache2 Passenger
  ## Install on Ubuntu by:
  ## sudo gem install passenger &amp;&amp; sudo passenger-install-apache2-module
  ## but only after running the install_and_configure_git.py script
  ## and creating a soft link to the rails gitlab /public directory like so:
  ## sudo ln -s /home/gitlabhq/gitlabhq/public /var/www/gitlab
  LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
  PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13
  PassengerRuby /usr/local/bin/ruby
  &lt;VirtualHost *:80&gt;
  
          ServerName gitlab
  
          ## Set the overall Document Root
          DocumentRoot /var/www
          &lt;Directory /var/www&gt;
                  Allow from all
          &lt;/Directory&gt;
  
          ## Set the Rails Base URI
          RackBaseURI /gitlab
          RailsBaseURI /gitlab
          &lt;Directory /var/www/gitlab&gt;
                  Allow from all
                  Options -MultiViews
          &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>