Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running gitblit on a port other than 80 clone links are not accurate #749

gitblit opened this issue Aug 12, 2015 · 5 comments


Copy link

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 453

What steps will reproduce the problem?
1. Set: server.httpPort = 8000; server.httpsPort = 0
2. Logon to gitblit (http://{HOST_NAME}:8000/
3. Navigate to repositories.
4. Open a repository

What is the expected output? What do you see instead?
Expected Output:
Repository URL = http://{USERNAME}@{HOST_NAME}:8000/r/{REPOSITORY_NAME}.git
What I See:
Repository URL = http://{USERNAME}@{HOST_NAME}/r/{REPOSITORY_NAME}.git

What version of the product are you using? On what operating system?
Version #1.6.0, just upgraded from v#1.5.1

Please provide any additional information below.
This also affects RSS feeds.

Reported by Spitfire5592 on 2014-06-20 14:23:00

- _Attachment: [](
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Forgot Operating System:
Windows 7 SP1 amd64

Reported by Spitfire5592 on 2014-06-20 14:23:58

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Generating the URL is a little tricky; there are several factors which can influence
it.  If given no other inputs, Gitblit will generate a url based on the request url
information and what it knows about the running services & ports.  So if you browsed
to localhost, then you would see localhost urls.  If you browsed to, then
you'd see urls.  This works fine until you want to "fix" the base url for
permalinks OR you are running behind a reverse proxy.  Gitblit supports tweaks for
both of these scenarios.

In your case, you have specified web.canonicalUrl.  If this url is specified, the hostname
and port of this url overrule anything else.  This url is also used to generate permalinks
in ticket notifications for emails and plugins.  It's actually a pretty important setting.

I think if you specify :port in this setting you will have more luck.

Reported by James.Moger on 2014-06-22 14:56:56

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

This worked, thank you.

web.canonicalUrl changed from:
web.canonicalUrl = http://it21
web.canonicalUrl = http://it21:8000

Reported by Spitfire5592 on 2014-06-23 19:00:10

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Reported by James.Moger on 2014-07-01 13:32:39

  • Status changed: Queued
  • Labels added: Milestone-1.6.1

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

v1.6.1 released

Reported by James.Moger on 2014-10-20 21:36:02

  • Status changed: Done

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 1.6.1 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants