Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 git.mydomain.com

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

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

redirect without signin to base : git.mydomain.com/users/sign_in ----> git.mydomain.com

for the moment i have a partial setup :

apache on server 1 (work without problem)

<VirtualHost *:80>

    ServerAdmin gilles.grandguillaume@gmail.com
    ServerName git.development
    ProxyRequests Off

    <Proxy http://127.0.0.1:8082/*>
            Order deny,allow
            Allow from 192.168.0. 127.0.0.1
    </Proxy>

    ProxyPreserveHost On

    ProxyPass /uploads !
    ProxyPass /error !
    ProxyPass / http://127.0.0.1:8082/

    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
    </Location>

second server with nginx (work more or less) :

server
{
    listen 80;
    access_log off;
    server_name git.mydomain.com;

    # 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
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.