[packages/gitlab-ce] update apache config

glen glen at pld-linux.org
Thu Nov 3 23:08:09 CET 2016


commit 29f3cd0c36af6e7102423ab8a529861d043e21d9
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Nov 3 23:47:32 2016 +0200

    update apache config
    
    from
    https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/web-server/apache/gitlab-apache24.conf

 apache.conf | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)
---
diff --git a/apache.conf b/apache.conf
index 332225a..81db17b 100644
--- a/apache.conf
+++ b/apache.conf
@@ -1,6 +1,12 @@
-#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
+# This configuration has been tested on GitLab 8.13
+# Note this config assumes unicorn is listening on default port 8080 and
+# gitlab-workhorse is listening on port 8181.
+#
+# To allow gitlab-workhorse to listen on port 8181,
+# edit or create /etc/sysconfig/gitlab-workhorse and change or add the following:
+# LISTEN_OPTIONS="-listenNetwork tcp -listenAddr 0.0.0.0:8181"
+
+# Module dependencies
 #  mod_rewrite
 #  mod_proxy
 #  mod_proxy_http
@@ -9,11 +15,16 @@
 	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 />
 		# New authorization commands for apache 2.4 and up
 		# http://httpd.apache.org/docs/2.4/upgrading.html#access
 		Require all granted
 
+		# Allow forwarding to gitlab-workhorse
 		ProxyPassReverse http://127.0.0.1:8080
 		ProxyPassReverse http://gitlab.example.org/
 	</Location>
@@ -22,8 +33,11 @@
 	# 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 %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
-	RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
+
+	# Forward all requests to gitlab-workhorse except existing files like error documents
+	RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
+	RewriteCond %{REQUEST_URI} ^/uploads/.*
+	RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA,NE]
 
 	# Needed for downloading attachments
 	DocumentRoot /usr/lib/gitlab/public
@@ -32,11 +46,12 @@
 	ErrorDocument 404 /404.html
 	ErrorDocument 422 /422.html
 	ErrorDocument 500 /500.html
-	ErrorDocument 503 /deploy.html
+	ErrorDocument 502 /502.html
+	ErrorDocument 503 /503.html
 
 	LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
-	ErrorLog  /var/log/httpd/gitlab_error.log
-	CustomLog /var/log/httpd/gitlab_forwarded.log common_forwarded
-	CustomLog /var/log/httpd/gitlab_access.log combined env=!dontlog
-	CustomLog /var/log/httpd/gitlab.log combined
+	ErrorLog  logs/gitlab_error.log
+	CustomLog logs/gitlab_forwarded.log common_forwarded
+	CustomLog logs/gitlab_access.log combined env=!dontlog
+	CustomLog logs/gitlab.log combined
 </VirtualHost>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gitlab-ce.git/commitdiff/3ed674bdae5da7de504f386ca73da69ebf9974bd



More information about the pld-cvs-commit mailing list