Hosting octopus behind IIS 7 reverse proxy

Has anyone successfully exposed octopus with IIS 7 reverse proxy? Have the site 85% working. Links within GROUPS do not work and some other areas. If so, would like to know how you got it 100%. Teamcity is running on 8081 and octopus is running on port 8082. Adding my current config to help anyone else.

current rules in web.config










web.config (1 KB)

Yeah I have it working. I have Gitblit, TeamCity and Octopus Deploy on the same Windows Server.

I installed the IIS URL Rewrite Module and the Server Farm module you can get it from Microsoft… you’ll have to google for it, I don’t remember where exactly I got it.

I created 3 domain C-Names, and pointed them at the same server:

  1. code.{yourdomain}.com
  2. build.{yourdomain}.com
  3. deploy.{yourdomain}.com

Then I set up the server the following way:

  1. I just installed Octopus Deploy, and then setup the Host name bindings for it.
  2. I installed TeamCity and setup Url Rewrite rules in IIS to forward requests coming in for ‘Build..com’ to the TeamCity port.
  3. I installed GitBlit and setup Url Rewrite rules in IIS to forward requests coming in for ‘code..com’ to the GitBlit port.

Your setup is different than what I was trying to accomplish. I have ARR installed and working but im not using a server farm. Trying to get this working on a single server. Have an internal CNAME. .i.e. thebuild.internal.com. teamcity is running on 8081. Octopus is running on 8082. Inbound rules are setup to forward all request as follows.
http://thebuild.internal.com/teamcity -> localhost:8081
http://thebuild.internal.com/octopus -> localhost:8082
For the most part it works well. But I have noticed that my rewrites do not work when I click on a GROUP name.
Example: if I click on Administrators group. The request is sent to
http:// thebuild.internal.com/configuration/groups/edit/groups-administrators
The correct request should be
http:// thebuild.internal.com/octopus /configuration/groups/edit/groups-administrators
The setup im trying to accomplish using a single CNAME may not be the correct route. Thinking I might have to take your route and add a specific CNAME for each application.
i.e. teamcity. thebuild.internal.com & octopus.thebuild.internal.com

So that rewrite module frankly is shit. I buggers up url’s with forward slashes in it, which I think is why you should look at doing it the way I am.

I spent a bunch of time trying to get it correctly rewrite URL’s such as this:
http://the.server.com/repo/1/groups/3/users

To be like this:
http://the.server.com:8080/repo/1/groups/3/users

I found that IIS rewrite would double encode the “/”, I tried every trick I could think of it would just fuck up the “/”. Thats why I finally gave up and did it the way I did, that way for Octopus, your just relying on Host Headers to route the request. If you go through the logs you’ll see how it is screwing up the url. Either that, or go with a different rewrite module that isn’t so buggy. Try this one mod-rewrite

Hope this helps.

Hi folks,

I am trying the same. I have a lot of web services running with reverse proxys (TeamCity, Jira, Confluence etc etc), but it fails with Octopus Deploys.

I have something like octopus..de and it gets redirected in the browser to octopus.de:9100. Obviously i can’t access Port 9100 from my university’s network, which is why I want to use the reverse proxy. How can I avoid that 9100 is appended?

regards,
christian

Christian,
I have successfully used the Rewrite module on IIS to reverseproxy both an Octopus early beta, and now v2.0. So far haven’t had any issues with these.

Post your rewrite setup and perhaps I’ll be able to help out.

Hi Peter,
I found out, that if I manually remove the port from the url, everything is working quite fine. I assume it’s a problem with the bindings from Octopus itself.
I’ve set them to:
http://localhost:9100
and
http://myDomain.de:9100

What are your settings on these?

UPDATE:
I just changed my binding be just: http://localhost
Now everything is working fine. Ain’t that a bit contra intuitive? Since the service is still hostet on port 9100…

Christian,
I have set only one listen prefix and that is “http://servername:port”.

This is a big issue for us.

We are using ARR (Application Request Routing http://www.iis.net/downloads/microsoft/application-request-routing) and first time you get to
http://somedomain.com you’ll get redirected to http://somedomain.com:8001 which obviously will fail.

So how to configure the OctopuseDeployment server to avoid this redirect in the first place?

DotNetWie - sounds like an ARR challenge more than an OD one, there might be some more knowlegeable folks on the related forums. If you think the redirect is coming from Octopus, can you please post the raw HTTP response headers for the 301/2? Cheers!

Well to bring this one up again: The behaviour is quite odd. I am mostly using ARR here to be able to access OD from my university where everything except port 80/443 is blocked. Sometimes it will redirect me to http://octopus.mydomain.de, sometimes to http://octopus.mydomain.de:9100. When accessing from any other, non-restricted side, I will always get redirected to http://octopus.mydomain.de:9100. I have no clue why that happens, since I use the exactly same ARR config for a lot of other tools (Confluence, JIRA, TeamCity etc.) and it works like a charm.

This thread’s become the “knowledge base” on this one - hopefully some explanations to find there: https://github.com/OctopusDeploy/Issues/issues/437

Regards,
Nick