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 2 servers :

  • first : contain gitlab + apache proxy , on my internal network domain git.development
  • second : server front-end only nginx, on my public domain

i want "chrooted" on the directory "public" of the gitlab with the second server.

directory "public" base of public web server : git.development/public ---->

redirect without signin to base : ---->

for the moment i have a partial setup :

apache on server 1 (work without problem)

<VirtualHost *:80>

    ServerName git.development
    ProxyRequests Off

            Order deny,allow
            Allow from 192.168.0.

    ProxyPreserveHost On

    ProxyPass /uploads !
    ProxyPass /error !
    ProxyPass /

    CustomLog ${APACHE_LOG_DIR}/development.3.git.access.log combined
    ErrorLog ${APACHE_LOG_DIR}/development.3.git.error.log

    # Modify path to your needs (needed for downloading attachments)
    DocumentRoot /home/git/gitlab/public

    <Location />
            Order allow,deny
            Allow from all

second server with nginx (work more or less) :

    listen 80;
    access_log off;

    # select the correct apache subdomain
    proxy_set_header  Host  git.development;

    rewrite ^/public(/.*)$ $1 last;

    location / {

            proxy_pass http://git.development/public/;
            proxy_cache cache;
            proxy_cache_valid 12h;
            expires 12h;
            proxy_cache_use_stale error timeout invalid_header updating;


    location ~*^.+(swf|ttf|woff|jpg|jpeg|gif|png|ico|css|txt|mid|midi|wav|bmp|rtf|js)$ `{`
            proxy_pass http://git.development;
            proxy_cache cache;
            proxy_cache_valid 10d;
            expires max;


In reality i dont know if it's technically possible to enforce the public web server on one directory of another without disturb the working of gitlab, maybe it's not the good way for this type of thing also a link with a similar problem can help me.

share|improve this question
i really dont understand ... – that guy from over there Sep 2 '13 at 6:37

Your Answer


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

Browse other questions tagged or ask your own question.