Reverse Proxy on Separate Host?

Hi, I think I may have something, but I think we’re breaking new ground here. Which is to say, I don’t believe anyone’s ever done this.

(1) You want to set the host as your intermediary. This means every connection.yml will have your intermediary proxy as the host.

set_host: "host=$(echo my.intermediary.proxy)"

You probably want to set this for the entire cluster instead of in every submit.yml. Here are docs for the same.
https://osc.github.io/ood-documentation/latest/reference/files/submit-yml-erb.html#setting-batch-connect-options-globally

(2) Then you’ll need to pass back the real host through conn_params. Here’s how that works. You should also set these to be cluster wide (as a pose to setting it for every single app)

(3) Now at this point, your apps will know all the information they need, you need to use them in the form. I’d suggest starting with an app like Jupyter instead of desktop, just to defer the whole noVNC situation, because that may need additional stuff that I don’t have offhand.

Here’s a view.html.erb I took from our Rstudio (changing rnode to node). You see the URL we’re redirecting to has host which you’ve set as a static string in #1 and the_real_host you’ve configured in #2.

I believe you’ll have to always use /node as a post to /rnode. Our proxy will remove /rnode/host/port portions of the URL when sending to rnode (because it’s relative). You’ll need to keep these intact so your intermediary can then determine what to do/remove.

<form action="/node/<%= host %>/<%= the_real_host %>/<%= port %>/auth-do-sign-in" method="post" target="_blank">
  <input type="hidden" name="username" value="<%= ENV["USER"] %>">
  <input type="hidden" name="password" value="<%= password %>">
  <input type="hidden" name="staySignedIn" value="1">
  <input type="hidden" name="appUri" value="">
  <button class="btn btn-primary" type="submit">
    <i class="fa fa-registered"></i> Connect to RStudio Server
  </button>
</form>

(4) At this point we’re talking to your intermediary, we’re proxying to it. Now comes the hard bit because you likely have to modify the URL to fit what the app is expecting and do the actual proxying. I don’t believe you can just use another OOD installation as the URL has an extra host in it so it may throw off our parsing expectations.