
ich habe 2 Server:
- zuerst: enthält Gitlab + Apache-Proxy, in meiner internen Netzwerkdomäne git.development
- zweitens: Server-Frontend nur nginx, auf meiner öffentlichen Domain git.mydomain.com
ich möchte mit dem zweiten Server im Verzeichnis „public“ des Gitlabs „chrooten“.
Verzeichnis „public“ Basis des öffentlichen Webservers: git.development/public ----> git.mydomain.com
Umleitung ohne Anmeldung zur Basis: git.mydomain.com/users/sign_in ----> git.mydomain.com
im Moment habe ich ein Teil-Setup:
Apache auf Server 1 (funktioniert problemlos)
<VirtualHost *:80>
ServerAdmin [email protected]
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>
zweiter Server mit nginx (funktioniert mehr oder weniger):
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;
}
}
Tatsächlich weiß ich nicht, ob es technisch möglich ist, den öffentlichen Webserver einem Verzeichnis eines anderen aufzuzwingen, ohne die Funktionsweise von Gitlab zu stören. Vielleicht ist das für solche Dinge nicht der richtige Weg. Auch ein Link mit einem ähnlichen Problem könnte mir helfen.