TeamCity 5.1.2 on HTTPS: URLs redirect to HTTP in build config pages

We've closed HTTP ports on the firewall and TeamCity is available on HTTPS only.
Problems are with project setting-related links. Everything which navigates to project settings and looks like this:     

ends up redirecting to     

As a result, to edit build runner props or simply view build config settings, when I'm outside the corporate firewall,
I end up with copying the link to clipboard, pasting it to browser address line and removing the "INIT=1&".

Everything else (server admin, build history, build logs etc) works fine.
Any hints?

Some more details:
1) server's base url is https-based
2) there is no redirection set up anywhere (yes, I looked through some older bug requests in issue tracker)
3) When I'm on the local network, that's not an issue, 'cause TeamCity listens on both http and https.

Comment actions Permalink


Looks like underconfigured HTTPS-to-HTTP redirection that does not support redirect URLs rewriting.
See details in my comment to TW-11166.

Comment actions Permalink

Yes, by the time of posting the question I've seen the issue you pointed me to.
I also created an issue in youtrack:

BTW, I will have to correct the problem report, because server admin URLs (those with INIT=1 in query string) also have the same redirection issue.

However, two things prevent me from taking your post as answer:

# issues with https/http are only observed with
## build and OTHER configuration pages which have "INIT=1" in the query string, \\ I can workaround this by copy-pasting the URL and removing INIT=1
## login page
# all other pages which don't have INIT=1 in query string are opened properly and do not experience redirection problems

These two things make me think that TeamCity might have a problematic redirection logic.
I see this as a problem because:
# TeamCity IS able to figure out the original URL, because URLs with https:/..../*INIT=1* have correct scheme prefix and domain name, and if I manually remove that *INIT=1* from query string, they work as expected
# TeamCity also has HTTPS-based server base address specified in settings

Comment actions Permalink


For the correct functioning of TeamCity you must setup correct redirection URL rewriting in your proxying software.
Unless you do so, some functionality (like URLs with "init=1") might not function correctly.

You seem to request a change in TeamCity: not to use client redirects. That can be filed as a separate feature request, but I am not sure it is either doable or of high priority as correct proxying software setup eliminates the issue.

> TeamCity also has HTTPS-based server base address specified in settings

Using the settings-specified address is not a good approach for client redirects as using the original URL as a base has much less side effects.

Comment actions Permalink

What do you mean by "correct redirection URL rewriting in your proxying software" ?
Should we simply rewrite everything which goes to TeamCity with HTTPS prefix?

Comment actions Permalink

By "correct redirection URL rewriting in your proxying software" I mean that if the software changes "https" to "http" for all incoming requests, it should also change "http" to "https" in all the client redirect responses like "HTTP 302 Moved temporarily".
e.g. for nginx that would be configured in proxy_redirect block.

Comment actions Permalink

Thank you! Will go this way.


Please sign in to leave a comment.