Octopus 3.0 reverse proxy api 502

I’m trying to setup a reverse proxy in IIS so calls to http://octopus.mydomain.com:8080 are internally rewritten to http://internal_ip:8181. This works because when the external url is called you get redirected to /app and it tries to load.

The problem is that /api is not available. "Unhandled error when communicating with the Octopus Deploy server. The server returned a status of: 503"
When called manually (http://octopus.mydomain.com:8080/api) it also returns 502 service unavailalbe. When calling the api using the internal IP everything works fine.

Do I need to do some extra configuration to make the rest API work externally?

Hi Danny,
I have just set up a simple IIS Reverse Proxy admitedly to the same local machine without any major problems.

These are the steps I used to get it to work (obviously step 1 doesn’t apply in your case)

  1. Setting up a host Blah to direct to 127.0.0.1 on my local machine
  2. Octopus server bound to http://localhost
  3. Set up IIS Site bound to http://*:88.
  4. IIS Reverse Proxy rule set up with inbound rule to forward to http://localhost:80
  5. Calling either http://blah:88/api or http://localhost/api both work fine (as does the portal itself).

I am a bit curious as to why the server itself would be failing with a 503. Is this coming from IIS or the Octopus deploy instance? Perhaps check the IIS\Windows logs or the Server logs to see if it provides any further information.
To confirm, are you saying that the portal resources itself are returning correctly and its only API calls that fail? i.e. if you request http://octopus.mydomain.com:8080/img/machines/Server-CalamariNeedsUpgrade.Ssh.png that is correctly redirecting content from the internal server but http://octopus.mydomain.com:8080/api fails?

Thanks for the extra information,
Cheers,
Rob

The same problem occurs when I configured the url rewrite as you described - but rewriting to the other server instead of localhost. Attached you’ll find a screenshot of my original URL rewrite, it’s the same as the one I use for TeamCity which works fine (also running on an other server) .

The 503 error seems to be coming from the octopus deploy instance.
The portal instance works fine; when I use the url from your post it returns an image.

Octopus Deploy only has 1 binding: http://localhost:8181/

Windows Event Viewer doesn’t show anything related to Octopus.
The Octopus Deploy server log only shows INFO and higher, is there a way to set this to VERBOSE?

If you’re interested I can (privately) send you the external URL.

octopus_api_503.png

Danny,
I have just tried from another machine, redirecting to my local dev machine and again it all seems to have worked fine (screenshot attached).
In IIS I have created a dummy site, then clicked URL Rewrite → Add Rule → Reverse Proxy.
While Im certainly not networking expert, I would be happy to take a support call and see if we can go though your set up together. Then, when the time approaches we will send through GoToMeeting details to enable you to join the call. I’ll then be able to take a look at the configuration you have set up, and hopefully help work out what needs to change.
It looks like from the Octopus point of view it should just work, but we know that in IT thats not always the case :). The fact that the server itself is giving 503 seems odd.
Look forward to talking to you,
Cheers,
Rob

Screen_Shot_2016-04-08_at_6.54.06_PM.png