Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an apache2 server running on a Mac OS X machine with the same machine running Gitlab virtually in Ubuntu.

Mac IP:

Ubuntu (virtual) IP:

I would like apache to make to go to the Ubuntu virtual machine while go to the Mac.

I added a file (gitlab.mydomain.conf) to /private/etc/apache2/other/ (on the Mac) with the following contents

<VirtualHost *:80>
  ProxyPass /
  ProxyPassReverse /
  ProxyPreserveHost On


The gitlab.yml on the Ubuntu virtual machine file contains

##Gitlab settings
  ## Web server settings
  port: 80
  https: false

When I go to I get the following error:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /users/sign_in.

Reason: DNS lookup failure for:

But if I go to I get the Gitlab sign in page.

Any ideas on what is wrong?

share|improve this question
Can someone with enough reputation add a Gitlab tag to this question? – Isak T. Jun 1 '13 at 15:25


<VirtualHost *:80>
  ProxyPass /
  ProxyPassReverse /
  ProxyPreserveHost On

From mod_proxy ProxyPass docs

If the first argument ends with a trailing /, the second argument
should also end with a trailing / and vice versa. Otherwise the
resulting requests to the backend may miss some needed slashes and
do not deliver the expected results.
share|improve this answer

I guess you haven't searched enough.

  1. You will need to edit file /home/gitlab/gitlab/config/unicorn.rb
  2. Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen ""
  3. Enable the apache module proxy with sudo a2enmod proxy
  4. Enable the apache module proxy_http with sudo a2enmod proxy_http
  5. Add this to your virtual host

    <VirtualHost *:80>
    # Custom log file locations
    ErrorLog /var/log/apache2/gitlab_error.log
    CustomLog /var/log/apache2/gitlab_access.log combined
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass /
    <Location />
        ProxyPassReverse /
        Order deny,allow
        Allow from all

  6. Restart gitlab & apache

  7. Have fun.

share|improve this answer
Awesome answer. Thanks for posting that. – Sebastian Sastre Feb 12 '14 at 10:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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