
나는 2개의 서버를 가지고 있습니다:
- 첫 번째 : 내부 네트워크 도메인 git.development에 gitlab + apache 프록시를 포함합니다.
- 두 번째 : 내 공개 도메인 git.mydomain.com의 서버 프런트 엔드 전용 nginx
나는 두 번째 서버가 있는 gitlab의 "public" 디렉토리에 "chrooted"를 원합니다.
공용 웹 서버의 "공용" 디렉토리: git.development/public ----> git.mydomain.com
로그인하지 않고 기본으로 리디렉션 : git.mydomain.com/users/sign_in ----> git.mydomain.com
지금은 부분 설정이 있습니다.
서버 1의 아파치(문제 없이 작동)
<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를 사용하는 두 번째 서버(다소 작동):
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;
}
}
실제로 gitlab의 작업을 방해하지 않고 다른 디렉토리의 한 디렉토리에 공용 웹 서버를 적용하는 것이 기술적으로 가능한지 모르겠습니다. 아마도 이런 유형의 작업에는 좋은 방법이 아닐 수도 있으며 비슷한 문제가 있는 링크가 도움이 될 수 있습니다.