는, 예를 들어, gitlab 7.4.5, 더 gitlab - 자식-HTTP 서버 (gitlab-주력)이 없습니다. 그러나 gitlab 7.4.5가 문서에서 suburi를 사용하기위한 몇 가지 해결책이 있습니다.
config/gitlab.yml
# WARNING: See config/application.rb under "Relative url support" for the list of
# other files that need to be changed for relative url support
# relative_url_root: /gitlab
# Relative url support
# Uncomment and customize the last line to run in a non-root path
# WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this.
# Note that following settings need to be changed for this to work.
# 1) In your application.rb file: config.relative_url_root = "/gitlab"
# 2) In your gitlab.yml file: relative_url_root: /gitlab
# 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"
# 4) In ../gitlab-shell/config.yml: gitlab_url: "http://127.0.0.1/gitlab"
# 5) In lib/support/nginx/gitlab : do not use asset gzipping, remove block starting with "location ~ ^/(assets)/"
#
# To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
#
# config.relative_url_root = "/gitlab"
config/application.rb
는 gitlab 7.4을 구성.5 다른 웹 사이트와 같은 포트와 동일한 도메인 이름을 nginx 구성 또는 아파치 구성 파일을 사용하여 5 여전히 도전 보인다. 나는 이것을 얻지 못했다. www.mydomain.com/gitlab으로 gitlab에 액세스 할 수 있지만 www.mydomain.com을 사용하여 다른 루트 디렉토리에 다른 웹 사이트를 가져 오지 못했습니다. configure nginx 또는 apache에 의해 거부되어야합니다. nginx 나 apache에 익숙한 사람들이 해결책을 줄 수 있기를 바랍니다.
기타 참조 자료. Support installing GitLab in a relative URL path or sub directory #1950
편집
그것은 작동합니다.
stackoverflow 여기 예제로 www.example.com을 사용하는 것이 좋습니다.
www.example.com/gitlab 액세스 gitlab
www.example.com 다른 웹 사이트 (예 : 내 블로그)에 액세스하십시오.
단계 :
- 설정/application.rb 파일 : config.relative_url_root = "/ gitlab"
- 설정/gitlab.yml 파일 : relative_url_root :/gitlab
- 설정/unicorn.rb : ENV [ 'RAILS_RELATIVE_URL_ROOT'] = "/ gitlab"
- ../gitlab-shell/config.yml : gitlab_url : /의 nginx/gitlab
"http://www.example.com/gitlab"
- 복사 lib 디렉토리/지원의 nginx에 대한 gitlab.conf하고 자산을 사용하지 않는 gzipping, 블록 별 삭제 팅
"location ~^/(assets)/"
- 실행과 : sudo는 -u 자식 -H 간부 레이크 자산 번들 : 사전 컴파일 RAILS_ENV을 = 생산
의 URL :
- 설정/gitlab.yml 파일 : 호스트 : example.com 포트 : 80
- 설정/unicorn.rb : 수신 "127.0.0.1:9095"
- ../gitlab-shell/config.yml : gitlab_url :
http://www.example.com/gitlab
,451,515,
gitlab 액세스에 자식에게 두 가지 방법을 제공합니다 :
- [email protected]을 : 샘플 project.git
- http://example.com/gitlab/sample-project.git
내가 HTTPS를 사용하고 있지 않다.
당신이 가지고있는 경우 :
을 당신은 host: example.com/gitlab
로 config/gitlab.yml
을 구성 할 수 있습니다. /gitlab
을 삭제하면됩니다.
의 nginx 구성 파일 :
###################################
## configuration ##
###################################
##
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0;
}
## Normal HTTP host
server {
#listen *:80 default_server;
listen *:80 default_server;
server_name www.example.com; ## Replace this with something like gitlab.example.com
server_tokens off; ## Don't show the nginx version number, a security best practice
#root /home/git/gitlab/public;
root html;
location /{
#root html;
index index.html index.htm;
}
## Increase this if you want to upload large attachments
## Or if you want to accept large git objects over http
client_max_body_size 20m;
## Individual nginx logs for this GitLab vhost
access_log logs/example.gitlab_access.log;
error_log logs/example.gitlab_error.log;
location /gitlab {
alias /home/git/gitlab/public;
## Serve static files from defined root folder.
## @gitlab is a named location for the upstream fallback, see below.
try_files $uri $uri/index.html $uri.html @gitlab;
}
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
# gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://gitlab;
}
## Enable gzip compression as per rails guide:
## http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
## WARNING: If you are using relative urls remove the block below
## See config/application.rb under "Relative url support" for the list of
## other files that need to be changed for relative url support
#location ~ ^/(assets)/ {
# root /home/git/gitlab/public;
# #gzip_static on; # to serve pre-gzipped version
# expires max;
# add_header Cache-Control public;
#}
error_page 502 /502.html;
}
아파치 (2.2.9) 구성 파일을 참조 gitlab.conf gitlab 8.0.0에 대한 gitlab 6.0.6 및 gitlab-8.0-apache2.2.conf에 대한 아파치 2.2
# Module dependencies
# mod_rewrite
# mod_proxy
# mod_proxy_http
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/data/webapp/www/wordpress"
ServerName www.example.com
ServerAlias example.com
#ErrorLog "logs/wordpress-error_log"
#CustomLog "logs/wordpress-access_log" common
#SetEnv ZF2_PATH "/data/webapp/www/ZendFramework-2.3.3/library"
SetEnv APPLICATION_ENV "development"
<Directory /data/webapp/www/wordpress>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#ServerName www.example.com
ServerSignature Off
ProxyPreserveHost On
# Ensure that encoded slashes are not decoded but left in their encoded state.
# http://doc.gitlab.com/ce/api/projects.html#get-single-project
AllowEncodedSlashes NoDecode
<Location /gitlab>
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:9095
ProxyPassReverse http://www.example.com//
RewriteEngine on
#RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:9095%{REQUEST_URI} [P,QSA,NE]
</Location>
#apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
# RewriteEngine on
# RewriteCond /code/gitlab/{REQUEST_FILENAME} !-f
# RewriteRule .* http://127.0.0.1:9095%{REQUEST_URI} [P,QSA,NE]
# needed for downloading attachments
#DocumentRoot /home/git/gitlab/public
Alias /gitlab /home/git/gitlab/public
#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
ErrorDocument 404 /404.html
ErrorDocument 422 /422.html
ErrorDocument 500 /500.html
ErrorDocument 503 /deploy.html
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog logs/example.com_error.log
CustomLog logs/example.com_forwarded.log common_forwarded
CustomLog logs/example.com_access.log combined env=!dontlog
CustomLog logs/example.com.log combined
</VirtualHost>
내가 가지고 원래의 질문과 비슷한 문제, 그리고 그것을 해결하는 방법을 시도했다. 내 오류 로그에는 새로운 항목이 없으므로이 문제만으로는 문제가 해결되지 않습니다. 내가하려는 것은 http://unicorn.bogomips.org/examples/nginx.conf와 같은 것에 당신의 제안을 적용하는 것이다. –