Giter Site home page Giter Site logo

Use a different URL. about core HOT 22 OPEN

c9 avatar c9 commented on August 16, 2024 7
Use a different URL.

from core.

Comments (22)

nightwing avatar nightwing commented on August 16, 2024 5

Simply using nginx rewrite might not work because client doesn't use relative urls.
https://github.com/c9/core/blob/master/settings/standalone.js
https://github.com/c9/core/blob/master/plugins/c9.vfs.standalone/standalone.js#L55
https://github.com/c9/core/blob/master/plugins/c9.static/cdn.js#L29 likely need to be modified to allow this

from core.

daozhenpan avatar daozhenpan commented on August 16, 2024 1

I have tried to change some profiles and it does work in my cloud9.There are files which I have modyfied.I hope it will help someone.
为了满足 相对路径要求 需要的更改的源码内容
server端:变更带有特征的路由
###get/post请求路由规则 修改api.get规则
/c9sdk/plugins/c9.vfs.standalone/standalone.js
###第三方插件的静态文件响应 修改section
/c9sdk/plugins/c9.static/cdn.js
###cloud9自己的静态文件响应
/c9sdk/node_modules/connect-architect/connect.static/static-plugin.js
###响应"vfs"路径的请求
/c9sdk/plugins/c9.vfs.server/vfs.server.js

##client端的相对路径变更
###静态资源:dark.css(主题)文件请求路径
/c9sdk/plugins/c9.ide.layout.classic/preload.js
###静态资源:c9用到的第三方静态资源请求携带上下文
/c9sdk/settings/standalone.js
###静态资源:c9 自己的某些静态资源请求方式变更(for clear)
/c9sdk/plugins/c9.static/connect-static.js
###其余请求:vfs_update,_ping等请求发送使用相对路径
/c9sdk/plugins/c9.vfs.client/endpoint.js

##html页面
###欢迎页面:loading-flat.css 使用相对路径
/c9sdk/plugins/c9.ide.server/views/flat-load-screen.html
###欢迎页面:文件mini_require.js /require_config.js 使用相对路径
/c9sdk/plugins/c9.vfs.standalone/views/standalone.html.ejs

from core.

javruben avatar javruben commented on August 16, 2024

Check out this explanation for a way to have apache connect to cloud9 by proxying the url.
http://blog.viniciusprado.org/how-to-install-and-configure-cloud9-in-your-own-server/

from core.

BernardXiong avatar BernardXiong commented on August 16, 2024

Thank for your reply.
I have read your mentioned page. But I don't like the '/' root as the root of cloud9 and it's hard to create a new domain too. Any other way? Thank you so much.

from core.

javruben avatar javruben commented on August 16, 2024

I am not sure. You'd have to check the code. I'd welcome a patch for this.

from core.

BernardXiong avatar BernardXiong commented on August 16, 2024

OK, thank you. I will check the code later.

from core.

ClashTheBunny avatar ClashTheBunny commented on August 16, 2024

Why not just rewrite?
For NGINX from here:

location /c9/ {
    rewrite ^/c9(/.*)$ $1 break;
    proxy_pass  http://127.0.0.1:8181/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect    off;
}

from core.

balthild avatar balthild commented on August 16, 2024

same problem with me.

from core.

dabura667 avatar dabura667 commented on August 16, 2024

I tried accomplishing this solely with apache settings...

No dice...

I almost got it by regexing the referer request header as a condition for rewriting to proxy and add the new base path...

Would be nice if this was supported out of box.

from core.

abalter avatar abalter commented on August 16, 2024

Hello. This is a really important feature. I need to be able to run the editor on a shared hosting server where I do web development. I can't hog up port 80, and there are no other ports open (except 465).

from core.

matthijsbreemans avatar matthijsbreemans commented on August 16, 2024

I would like to see this as well

from core.

taemon1337 avatar taemon1337 commented on August 16, 2024

I was able to get pretty close using node's 'express-http-proxy' like this:

app.use('/ide|/static|/configs|_ping|/vfs', proxy(IDE_URL, {
  proxyReqPathResolver: function (req) {
    let u = url.parse(req.originalUrl).path.replace('/ide', '')
    console.log('[IDE] ' + req.originalUrl + ' -> ' + IDE_URL + u)
    return u
  }
}))

This would load all the content correctly, however there were definitely issues and was unusable, lots of loading without ever working.

Would love to see this issue resolved!

from core.

hvintik avatar hvintik commented on August 16, 2024

Hello,

Any news on when it will be fixed?

Thank you,

from core.

abalter avatar abalter commented on August 16, 2024

@hvintik -- I don't think it's a matter of being "fixed." It's really a feature request, not a bug report.

However, I am interested in the same thing because I want to use c9 on shared hosting.

Here is another thread about it.

https://community.c9.io/t/run-cloud9-under-subdirectory/8152

I still haven't tried the subdomain technique.

Also look at these:

https://stackoverflow.com/questions/48635552/how-to-programmatically-communicate-with-apache

https://stackoverflow.com/questions/48673359/how-to-properly-return-http-response-from-python-requests-library-want-a-python

from core.

mota57 avatar mota57 commented on August 16, 2024

wow I had more than a day on this! :(

from core.

Cesarot avatar Cesarot commented on August 16, 2024

I have the same issue , it would be nice that by the command:
node server.js -p 7000 -a : -w '/var/www/html' --listen 0.0.0.0 &
have a option for change the url of c9 server.

from core.

genestealer avatar genestealer commented on August 16, 2024

Check out this explanation for a way to have apache connect to cloud9 by proxying the url.
http://blog.viniciusprado.org/how-to-install-and-configure-cloud9-in-your-own-server/

This is now: http://vncprado.github.io/how-to-install-and-configure-cloud9-in-your-own-server/

from core.

genestealer avatar genestealer commented on August 16, 2024

I really want this, as my Apache proxy applies the SSL cert to all internal web pages, so I need to connect via https://mywebsite/somesubdirectory/ide.html

from core.

jnoxon avatar jnoxon commented on August 16, 2024

This is a blocker for me, too. I need to run this behind an NGINX reverse proxy on a different path. Surprised to find it isn't possible.

from core.

moppi79 avatar moppi79 commented on August 16, 2024

this is nice IDE, at home i can use it
but from work i have only Comunicate over port 80 and i have 2 Systems, a Produktive system include a Proxy and Dev system with IDE.

it is very frustrating that i cannot a simple

ProxyPass /c9ide/ http://192.168.x.x:8181/
ProxyPassReverse /c9ide/ http://192.168.x.x:8181/

from core.

mrfoxbit avatar mrfoxbit commented on August 16, 2024

I have the same issue. How to run it behind an NGINX reverse proxy?

from core.

StudioEtrange avatar StudioEtrange commented on August 16, 2024

/plugins/c9.static/connect-static.js

Hi @daozhenpan
Could you be more specific and tell us what changed you made in those files ?
thank you very much !

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.