TeamCity behind an Apache reverse proxy using SSL

I am using TeamCity behind an Apache reverse proxy. Apache is also used to handle https connections and the requests are forwarded using HTTP to TeamCity. This works great with some wired exceptions.

For example: Clicking the "Administration" link redirects not the HTTPS link but to the HTTP link. While the browser shows the link as HTTPS when hovering with the mouse over it after clicking it the URL is an HTTP URL. This also happens for some other links in TeamCity. The strange thing is, that most of the links work just fine. I set the base URL of TeamCity to https://teamcity.... but this did not help.

Can anyone help me on this?


-- Update

I had a look at the network logs of chrome and found the following:

The request for "" returns 302 with the new location "" while this should be ""


Comment actions Permalink

Hi Alexander,

It looks like misconfiguration in HTTPS-to-HTTP redirect. Please check that Apache proxy server is configured correctly:

Comment actions Permalink

Double checked that. The configuration is exactly the one stated in the documentation.

The strange thing is that TeamCity creates redirects starting with http instead https. At least I think it does.


Comment actions Permalink

Sorry about bringing this up again...

I got Teamcity running in a tomcat7 installation accessable via port 8080 and I'd like to use an apache2 proxy on the same machine to serve via a subdomain.
So therefore: gets me to the teamcity installation is supposed to get the same location.
My vhost.conf for apache looks like this:

  ProxyPass / ajp://localhost:8009/teamcity/
  ProxyPassReverse / ajp://localhost:8009/teamcity/

Entering: to my browser always redirects me to: and ends in a 404 error.

Entering gets me to the login page but without any stylesheets applied and the login fails.

What am I missing out? I'd like to serve teamcity via subdomain and not add the directory.
Moving teamcity to tomcats ROOT is not an option, after I run in the same problem as soon as I want to serve other tomcat apps.

Thanks for any help.

Comment actions Permalink

Hi Felix,

Please try to set up Apache proxy server the same way as proposed in the documentation:

Comment actions Permalink

Alright. So my vhost.conf looks like this:

  ProxyRequests Off
  ProxyPass /teamcity/app/subscriptions ws://localhost:8080/teamcity/app/subscriptions connectiontimeout=240 timeout=1200
  ProxyPassReverse /teamcity/app/subscriptions ws://localhost:8080/teamcity/app/subscriptions

  ProxyPass / http://localhost:8080/teamcity/ connectiontimeout=240 timeout=1200
  ProxyPassReverse / http://localhost:8080/teamcity/

Opening redirects me to: and shows the login page without applying stylesheets and images.

My browsers dev-console has a 404 for opening stylsheets at:

Any ideas?
Thanks for the help.
Comment actions Permalink


Please try the following config:

LoadModule  proxy_module          /usr/lib/apache2/modules/
LoadModule  proxy_http_module     /usr/lib/apache2/modules/
LoadModule  headers_module        /usr/lib/apache2/modules/
LoadModule  proxy_wstunnel_module /usr/lib/apache2/modules/

ProxyRequests       Off

ProxyPass           /app/subscriptions ws://localhost:8080/app/subscriptions connectiontimeout=240 timeout=1200
ProxyPassReverse    /app/subscriptions ws://localhost:8080/app/subscriptions

ProxyPass           /     http://localhost:8080 connectiontimeout=240 timeout=1200
ProxyPassReverse    /     http://localhost:8080

Comment actions Permalink

This just gets me to the tomcat7 root directory "It works" site.

For now, I added a second proxy.

One for "/" and one for "/teamcity" so the site is reachable by its subdomain and will redirect everything with /teamcity.

Works for us although it has the name doubled in the url:


Please sign in to leave a comment.