Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Versions:

  • Windows Server 2008 R2 SP1
  • TeamCity 7.0.2
  • Tomcat 7.0.27
  • IIS 7.5
  • ARR 2.5
  • URL ReWrite 7.2.2

TeamCity is installed into a pre-existing TomCat installation as a JavaEE WAR. IIS has been successfully setup to reverse proxy calls for TeamCity. My rewrite rule is below:

<rule name="TeamCity Redirect" stopProcessing="true">
    <match url="^(TeamCity.*)" />
    <action type="Rewrite" url="http://localhost:8080/{R:1}" logRewrittenUrl="true" />
</rule>

I have no problem logging into TeamCity from a remote host and using/administering it. However, when I enable the built-in NuGet server, I encounter a frustrating issue.

Trying to access the nuget feed from any remote host proxying through IIS gives me an HTTP 404 error. The 404 error comes from IIS. When I remove the final path part from the url, the 404 error comes from Tomcat.

Example:

So, somewhere I am having issues with IIS respecting a redirect with *.svc files, but for the life of me, I cannot figure out why, or where this is set.

Any help is greatly appreciated.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Seems you do not need any rewrite rules. Check TeamCity server context path is the same as in your public server, i.e. http://public.com/contextPath and http://localhost:8080/contextPath.

TeamCity uses request URI to generate NuGet feed, so you should make sure your proxy provides HOST, X-Forwarded-Host, X-Forwarded-Server, X-Forwarded-For headers. You may enable/check tomcat's access log to see what requests comes from IIS to TeamCity.

Please also take a look at the installation guide at http://blog.endjin.com/2010/11/a-step-by-step-guide-to-hosting-teamcity-in-iis-7/

If this does not work, please attach server logs to teamcity-feedback@jetbrains.com

share|improve this answer
    
That definitely resolves the server url issue. –  Joseph Alcorn Apr 26 '12 at 23:01
add comment

Ah, the power of posting. After asking the question, I decided to take a look at the rules I had setup one more time.

The rules were setup on the site level. I moved them to the server level, and everything works like a charm.

share|improve this answer
    
Adding the rule at server level definitively solved the problem. –  Julien Lebosquain Aug 8 '12 at 18:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.