Accessing externalStatus.html page from Local Area Network or Internet

I wonder if this is a bug ... or not.

When I insert the following scriptlet in a web page :
<script type="text/javascript" src="http://<my.external.Teamcity.domain.net>/externalStatus.html?js=1&withCss=true&projectId=project2&"> </script>

The base url used for links and images is my.internal.teamcity.machine.name
So, when I access the web page from my local network, it works, but it doesn't when trying to access through the internet.

Is this a "normal" behaviour ? If not, how can I correct it ? Should I change a config file ?

Thanks in advance.

-:: Pierre-Alain Galtier ::-

4 comments
Comment actions Permalink

please ignore this question.
It seems to be more an apache/tomcat question than a Teamcity one.

I'm publishing the teamcity server through an apache httpd server as virtual host (using the ProxyPass/ProxyPassReverse directives) and it appears that I missed a rewrite rule.

If you already succeeded in publishing Teamcity this way, I will be very happy to learn

-:: Pierre-Alain Galtier ::-

0
Comment actions Permalink

But, I realized that the Rewrite rules won't change the content of t
he page but only the url.

Maybe the solution is in a Teamcity change.

0
Comment actions Permalink

Hello,

  When the content of the external status is generated, TeamCity uses the hostname of the HTTP request sent to the Tomcat.
  So if your RewriteRule changes the request and the actual request is sent to internal URL, the generated page will contain internal host names as well.

  So, to fix the problem, you need to make sure that TeamCity server responds to the external URL directly, without rewriting rules.

  Hope this helps,
  KIR

0
Comment actions Permalink

Thanks for the information.

In order to force tomcat to think proxied requests were directed to my.external.Teamcity.domain.net on port 80,  I've updated the tomcat's server.xml file:


<Connector port="8800" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />


changed to :


<Connector port="8800" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" proxyName="my.external.Teamcity.domain.net" proxyPort="80"/>


for the logs (and other people trying this way of publishing too) my settings were :

Apache httpd (as proxy)
Tomcat
my.external.Teamcity.domain.net (port: 80) my.internal.teamcity.machine.name (port : 8800)


in my httpd.conf file, the virtual host was define as follow:

<VirtualHost 192.168.0.11:80>
    ProxyPreserveHost Off
    ProxyPass / http://my.internal.teamcity.machine.name:8800/
    ProxyPassReverse / http://my.external.teamcity.domain.net/
    ServerName my.external.teamcity.domain.net
    ServerAdmin buildmaster@my.external.teamcity.domain.net
    ErrorLog logs/my.external.teamcity.domain.net-error.log
    CustomLog logs/my.external.teamcity.domain.net-access.log common
</VirtualHost>



And it works !

Many thanks.

-:: Pierre-Alain Galtier ::-

0

Please sign in to leave a comment.