• 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" />

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.


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.


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.

  • Adding the rule at server level definitively solved the problem. – Julien Lebosquain Aug 8 '12 at 18:10

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

  • That definitely resolves the server url issue. – Joseph Alcorn Apr 26 '12 at 23:01
  • How do you ensure IIS adds the X-Forwarded.... headers? My NuGet feeds (from Octopus Deploy) are not working, and I am wondering if this is the reason? – David Keaveny Feb 20 '17 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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