[SDK Hosting] Need help with running two SDK instances under the same domain


#1

Hey people, I’m currently trying to run 2 C9 SDK instances on the same server under the same domain name
So far, I’ve managed to get the two instances to be differentiated at dev.cyberiumshadow.me/bot/ and dev.cyberiumshadow.me/repo/

Images are here: http://imgur.com/a/GJiJO
However only this happens
Refer to Image 1 in the Imgur Album
As you can see, none of the static content such as CSS or Scripts are being loaded and upon further investigation, the SDK assumes its being served at the root domain being dev.cyberiumshadow.me/ide.html as as such, theoretically does not exist in terms of the nginx reverse proxy as shown here
Refer to Image 2 in the Imgur Album
and here (This is a CSS file that is supposed to be run by the ide.html but as you can see here, its expecting it at the wrong address Refer to Image 3 in the Imgur Album

I’ve attempted to patch the SDK to allow it to serve its static content at the respective addresses to no avail.

Is there anyone that can or has done this before and are able to assist me?


#2

if i could get a reply with some help, That’d be appreciated


#3

Not sure if it would work, but maybe use an NGINX reverse proxy to route requests and use URL rewrites to internally rewrite to the Cloud9 SDK?


#4

Yeah, I’ve gotten the reverse proxy to work

However as seen here


The inde.html expects the CSS and require scripts to be at dev.cyberiumshadow.me and not dev.cyberiumshadow.me/workspace/

I’ll have a look at using URL rewrites, but is there any thing else that could be done in terms of the second issue?


#5

By “second issue,” are you referring to the patching of the Cloud9 SDK?


#6

Essentially yes.

I’ve had a look in the source for the SDK but can’t find where I’d be able to change an absolute path to become a relative path which I believe would enable the CSS and scripts to be correctly loaded.


#7

Unfortunately, I don’t have the time to look through the SDK, even though this would be useful to know for me, since I have several instances set up. What I’ve done in the past isn’t terribly user friendly, but for me, worked fine. The solution was to simply run each Cloud9 SDK instance on a different port, and I had to access it like that (so dev.example.com:3000 and then dev.example.com:3001 for the next instance, etc.


#8

That’s how I originally ran it, but since I’m using the SDK for collaborative purposes, I decided that user-friendliness would be better.

Thank you for the advice, I’ll probably spend a bit of time tweaking nginx to see if I can get it working.

If not, I’ll consider looking into the SDK and I’ll let you know if I get anything working.


#9

Looking through nginx a bit more, I don’t think its possible without a SDK tweak
For example

the CSS should be pointing at /workspace1/static/ etc.

instead its a absolute path to dev.cyberiumshadow.me


#10

indeed, it is not possible see https://github.com/c9/core/issues/11#issuecomment-151846177