I did this using the standard Teamcity Windows installer and supposedly worked on any platform.
Change Teamcity Location
According to a comment by a JetBrains employee :
To change the TeamCity address from http://server/
to http://server/teamcity/
, rename the <TeamCity home>\webapps\ROOT
to <TeamCity home>\webapps\teamcity
.
Please note that you will need to rename this directory each time you upgrade Teamcity.
Proxy configuration
The nginx configuration looks something like this:
location /teamcity/ { proxy_pass http://teamcity-server.domain.com/teamcity/; }
Or you can use Apache (I switched to Apache due to the authentication requirements that I had):
<Location /teamcity> ProxyPass http://teamcity-server.domain.com/teamcity ProxyPassReverse http://teamcity-server.domain.com/teamcity </Location>
Redirect old URL
I also created a new <TeamCity home>\webapps\ROOT
and put the index.jsp
file in it, which redirects to the new URL, so the old links continue to work (for example, if someone goes to http: // teamcity-server .domain.com it redirects to http://teamcity-server.domain.com/teamcity ):
<!DOCTYPE html> <html> <head> <title>TeamCity</title> <meta http-equiv="refresh" content="0;url=/teamcity/overview.html"/> </head> <body> </body> </html>
You can also do a redirect to nginx / apache, but execution on Teamcity server means that if someone goes to the old URL directly on the teamcity web server (instead of your proxy server), they will still be redirected correctly (instead this 404).
gregmac
source share