fd Blog

Daniel Hilgarth on software development

TeamCity 9 Behind Apache Proxy

TeamCity 9 uses WebSockets for UI updates. If you are using TeamCity 9 behind an Apache proxy, you will have to make some changes to the configuration for TeamCity 8.

  1. Make sure you are using version 2.4.5 or newer:

     $ apachectl -V
  2. Enable the Proxy WebSockets tunnel module:

     $ sudo a2enmod proxy_wstunnel
  3. Add the following ProxyPass rules to the Apache site configuration of your TeamCity installation - usually located in /etc/apache2/sites-available:

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

    Important: Add those lines directly above the already existing ProxyPass rule.

    The port has to be the same you used in the TomCat configuration of your TeamCity installation (see figure 8).

  4. Restart Apache:

     $ sudo service apache2 restart