gitlab 7.4.5 参照 1, 2 从源码安装。
本文 gitlab 7.4.5 运行环境 见 3。
nginx 配置参照源码自带配置 lib/support/nginx/gitlab
## gitlab## maintainer: @randx#### lines starting with two hashes (##) are comments with information.## lines starting with one hash (#) are configuration parameters that can be uncommented.###################################### chunked transfer ######################################## it is a known issue that git-over-http requires chunked transfer encoding [0]## which is not supported by nginx ## with git (i.e. a single large file) can lead to a 411 error. in theory you can get## around this by tweaking this configuration file and either:## - installing an old version of nginx with the chunkin module [2] compiled in, or## - using a newer version of nginx.#### at the time of writing we do not know if either of these theoretical solutions works.## as a workaround users can use git over ssh to push large files.#### [0] https://git.kernel.org/cgit/git/git.git/tree/documentation/technical/http-protocol.txt#n99## [1] https://github.com/agentzh/chunkin-nginx-module#status## [2] https://github.com/agentzh/chunkin-nginx-module####################################### configuration #######################################upstream gitlab { server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0;}## normal http hostserver { #listen *:80 default_server; listen *:80 default_server; server_name mydomain.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; ## 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/mydomain.gitlab_access.log; error_log logs/mydomain.gitlab_error.log; location / { ## 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;}
apache
apache(2.2.9) 配置参照 测试于 6.0.0 的 gitlab.conf,和测试于 8.0.0 的 gitlab-8.0-apache2.2.conf
########namevirtualhost *:80#this configuration has been tested on gitlab 6.0.0 and gitlab 6.0.1#note this config assumes unicorn is listening on default port 8080.#module dependencies# mod_rewrite# mod_proxy# mod_proxy_httpservername mydomain.com serversignatureoffproxypreservehoston# ensure that encoded slashes are not decoded but left in their encoded state.# http://doc.gitlab.com/ce/api/projects.html#get-single-projectallowencodedslashes nodecode order deny,allow allow from allproxypassreverse http://127.0.0.1:9095 proxypassreverse http://mydomain.com/ #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-gitlabrewriteengineonrewritecond%{document_root}/%{request_filename} !-f rewriterule .* http://127.0.0.1:9095%{request_uri} [p,qsa,ne]# needed for downloading attachmentsdocumentroot /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/mydomain.gitlab_error.log customlog logs/mydomain.gitlab_forwarded.log common_forwarded customlog logs/mydomain.gitlab_access.log combined env=!dontlog customlog logs/mydomain.gitlab.log combined
ps:
使用 relative url 的配置 见 gitlab 7.4.5 relative url configuration
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了gitlab 745 nginx apache 配置,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。