What steps will reproduce the problem?
1. Install the gitblit war in tomcat7
2. Create a symbolic link from webapps/gitblit-x.x.x to webapps/gitblit
3. Setup a subdomain proxy in Apache2 using AJP
(with the settings from http://gitblit.com/setup.html), forward the proxy to webapps/gitblit
(not the versioned url)
4. Go to git.mydomain.com and login
What is the expected output?
Login and be forwarded to
What do you see instead?
I am forwarded to
leading to a 404 error. When I remove the "/gitblit" part, i am logged in.
What version of the product are you using? On what operating system?
Gitblit: 1.1.0 war
Please provide any additional information below.
Appearently, somewhere in the code is a forward to the url of the webapp, this should
be a forward to the existing url.
Reported by imeelvanjoost on 2012-09-19 22:06:47
The text was updated successfully, but these errors were encountered:
I'll start backwards here.
Because the repository url is not a link (it is just text), Apache does not manipulate
the url when the page is proxied. I will add support for an optional X-Forwarded-Context
so that you can configure Apache to tell Gitblit what the appropriate context path
should be. These X-Forwarded parameters are only used to generate the repo url.
Login/logout. Hmmm. Perhaps you can pass along your config for a subdomain proxy.
My setup instructions do not include that info. They assume apache://gitblit and
tomcat://gitblit, i.e. context paths match. Perhaps there is a bug in Gitblit or perhaps
there is an additional config setting required for Apache. Don't know as I have never
used subdomain proxying.
Thanks for your response. In the meanwhile I found a solution for my problem. This also
involves setting up a host in tomcat
The following apache2 vhost maps a domain to the root of the tomcat server.
ProxyPass / ajp://localhost:8009/
In tomcat, add the following host to the server.xml. This makes gitblit the root app,
if the domain is git.mydomain.com
<Host name="git.mydomain.com" appBase="webapps" unpackWARs="true" autoDeploy="true"
<Context path="" docBase="gitblit" reloadable="true" privileged="true"
This however, does not fix an inconsistent url in the repository summary, in fact it
makes it worse.
But i supposed implementing x-forwarded-context as you proposed can fix this problem
Excuse me, my last comment is not right. I had multiple tabs open. One on my domain,
via apache, one directly to the server ip and directly into tomcat. I opened the wrong
one to check if the url was right.
The dual config in apache2 and tomcat completely fixes my problem. X-Forward does not
seem necessary to me any more. Maybe this information could be reflected in the documentation
on the website?
Tricky. I pushed the code for X-Fowarded-Context, if you'd like to build from source
and give that a go. This will only affect the context path, not the host. Perhaps
you will also need an X-Forwarded-Host.