我有2台服务器:
我想在第二台服务器上的“公共”目录“chrooted”的gitlab。
公共Web服务器的目录“公共”基础:git.development / public —-> git.mydomain.com
无需login即可redirect到基础:git.mydomain.com/users/sign_in —-> git.mydomain.com
目前我有一个部分的设置:
在服务器1上的Apache(工作没有问题)
<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>
第二个服务器与Nginx(工作或多或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; } }
实际上,我不知道是否技术上可以强制公共Web服务器上的另一个目录,而不打扰gitlab的工作,也许这不是这种types的事情的好方法也有类似问题的链接可以帮助我。