diff --git a/modules/gerrit/templates/gerrit.vhost.erb b/modules/gerrit/templates/gerrit.vhost.erb index 86a836ab75..b978ddce3e 100644 --- a/modules/gerrit/templates/gerrit.vhost.erb +++ b/modules/gerrit/templates/gerrit.vhost.erb @@ -43,17 +43,21 @@ RewriteEngine on RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("gerrit::virtual_hostname") %> RewriteRule ^.*$ <%= scope.lookupvar("gerrit::canonicalweburl") %> +<% if scope.lookupvar("gerrit::replicate_local") -%> RewriteCond %{REQUEST_URI} !^/p/ +<% end -%> RewriteRule ^/(.*)$ http://localhost:8081/$1 [P] ProxyPassReverse / http://localhost:8081/ +<% if scope.lookupvar("gerrit::replicate_local") -%> SetEnv GIT_PROJECT_ROOT /var/lib/git/ SetEnv GIT_HTTP_EXPORT_ALL AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/lib/git/$1 AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/lib/git/$1 ScriptAlias /p/ /usr/lib/git-core/git-http-backend/ +<% end -%> Order allow,deny