We have an IIS 7 webserver configured and would like to create a reverse proxy for a TeamCity installation using Tomcat on the same machine.
The IIS server site is https://somesite
and I would like the TeamCity to appear as https://somesite/teamcity
redirecting to http://localhost:portnumber
.
I have installed the IIS URL Rewrite extension and the Application Request Routing to try and setup a reverse proxy but can't get it working.
The closest answer I found is an old StackOverflow question:
https://stackoverflow.com/questions/331755/how-do-i-setup-teamcity-for-public-access-over-https
which unfortunately doesn't have any working example.
I've searched a quite a bit but can't seem to find a relevant example.
Any help is appreciated!
Having just spend around 4 hours trying to configure SSL for TeamCity (and using the answers in this thread), I managed to get this working using the server farm option.
I configured a TeamCity server farm which included my TeamCity server on 127.0.0.1 using port 8080, and allowed the Application Routing Rules to create a corresponding server farm routing rule.
I then created a website called TeamCitySecureProxy which I configured with a self-signed certificate. On the bindings I only configured https/443 (no http/80).
The part I was missing:- I then clicked on the 'TeamCity' node under 'Server Farms' in IIS, choose 'Proxy' from the 'Server Farm' pane, and ticked the 'Reverse rewrite host in response headers'.
I now have a secure end-point for accessing my plain http TeamCity installation.
Make sure ARR proxying is enabled in IIS GUI. You probably want preserve host header (may need to edit applicationHost.config by hand, or use appcmd to set this one) and reverse rewrite host in response header options enabled as well, so the browser makes requests, and sees responses, that match the SSL cert host.
(.*)
{URL}
matches^teamcity(/.*)?
http://localhost:port/{C:1}
I think that should do it.
You could also use a connector to do so.
There is the old ISAPI connector (redirector) available from Apache directly or there is also a new one available from RiaForge (this one seems easier to get running).
http://tomcatiis.riaforge.org/
I have just done this myself and have just posted a blog about it.
You appear to have installed all the requirements, now you just need to setup the server:
http://bronumski.blogspot.com/2010/10/host-teamcity-in-iis7.html