Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8791487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:50:58+00:00 2026-06-13T22:50:58+00:00

I am attempting to setup a proxy with Apache2 so that incoming requests to

  • 0

I am attempting to setup a proxy with Apache2 so that incoming requests to http://myipaddress.com go to http://localhost:3000/ 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?

## 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
<Proxy http://localhost:3000/>
  Order deny,allow
  Allow from all
</Proxy>

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!

ProxyPass /gitlab/ http://localhost:3000/gitlab/
ProxyPassReverse /gitlab/ http://localhost:3000/gitlab/

UPDATE:

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!

## For Gitlab using Apache2 Passenger
## Install on Ubuntu by:
## sudo gem install passenger && 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
<VirtualHost *:80>

        ServerName gitlab

        ## Set the overall Document Root
        DocumentRoot /var/www
        <Directory /var/www>
                Allow from all
        </Directory>

        ## Set the Rails Base URI
        RackBaseURI /gitlab
        RailsBaseURI /gitlab
        <Directory /var/www/gitlab>
                Allow from all
                Options -MultiViews
        </Directory>

</VirtualHost>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:50:59+00:00Added an answer on June 13, 2026 at 10:50 pm

    I came across this gist that worked for me. In case it ever goes dead, I’ll repost it.


    unicorn config file

    Edit file /home/gitlab/gitlab/config/unicorn.rb

    Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen "127.0.0.1:8080"

    required modules for apache

    • sudo a2enmod proxy
    • sudo a2enmod proxy_balancer
    • sudo a2enmod proxy_http
    • sudo a2enmod rewrite

    /home/gitlab/gitlab/config/gitlab.conf

    <VirtualHost *:80>
      ServerName git.domain.com
    
      # Point this to your public folder of teambox
      DocumentRoot /home/gitlab/gitlab
    
      RewriteEngine On
    
      <Proxy balancer://unicornservers>
        BalancerMember http://127.0.0.1:8080
      </Proxy>
    
      # Redirect all non-static requests to thin
      RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
      RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]
    
      ProxyPass / balancer://unicornservers/
      ProxyPassReverse / balancer://unicornservers/
      ProxyPreserveHost on
    
      <Proxy *>
        Order deny,allow
        Allow from all
      </Proxy>
    
      # Custom log file locations
      ErrorLog  /var/log/apache2/gitlab_error.log
      CustomLog /var/log/apache2/gitlab_access.log combined
    </VirtualHost>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to setup a MenuItem that will have a submenu of page numbers
I am attempting to setup a mod_rewrite that will do the following www.mysite.com/dir/ignoreMe will
I am attempting to setup a mod_rewrite that will do the following www.mysite.com/dir/ignoreMe will
I am attempting to setup a DataGridView on a form so that the row
so I added all the jars from jMock 2.5.1 While attempting to follow http://www.ibm.com/developerworks/opensource/library/os-eclipse-rmock/index.html
I'm a relatively new linux and rails dev and I'm attempting the following setup:
I'm attempting to setup a .csproj file to have a conditional item group which
I am attempting to install libxml2 so that I can setup the python bindings
Im attempting to take a string that is in a partial comma separated setup.
I'm attempting to setup Ruby on Rails on IIS7. I've been reading lots of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.