code-server icon indicating copy to clipboard operation
code-server copied to clipboard

base url support

Open majikxu opened this issue 7 years ago • 25 comments

I wanne run behind proxy

majikxu avatar Mar 14 '19 16:03 majikxu

This block is working correctly for when a baseurl is provided (via the currentUrl variable). Examples I tested with were https://example.com/code/ and https://example.com/my/long/baseurl/.

By working, I mean that https://example.com/code/ => https://example.com/code/login https://example.com/code/login => https://example.com/code/ https://example.com/my/long/baseurl/ => https://example.com/my/long/baseurl/login https://example.com/my/long/baseurl/login => https://example.com/my/long/baseurl/

https://github.com/codercom/code-server/blob/c3a38e3fea8a28afa4017cf6c45ba12e82ff1feb/packages/server/src/server.ts#L193-L211

au5ton avatar Apr 24 '19 20:04 au5ton

I have succeeded to run code-server in a subpath behind nginx using a rewrite. It mostly seems to work, even without anything "baseurl" related. ´´´ location /vscode { rewrite /vscode/(.*) /$1 break; proxy_pass http://vscode:8443; proxy_redirect off; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; }

´´´

AKKlostermann avatar May 15 '19 11:05 AKKlostermann

Has the team considered implementing this feature?

Today is the first day I tried this damn cool project. 🎉 But when I deployed it to my HTTP server, I ran into the same problem. And the #307 doesn't seem to solve the problem of the HTTP request's paths. Now my HTTP server will still receive requests for files such as *.css and *.js under the root path instead of under the /vscode.

aofei avatar May 17 '19 12:05 aofei

CC @coadler and @Multishifties, looks like this issue is persistent, and we have multiple significant use cases. Recommending escalation.

sr229 avatar May 17 '19 15:05 sr229

I'll tag Kyle for this one since this feature has been requested a lot.

@kylecarbs

MichaelDesantis avatar May 18 '19 15:05 MichaelDesantis