Skip to content

Make Asset Paths Relative #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
srsgores opened this issue Apr 14, 2019 · 5 comments
Closed

Make Asset Paths Relative #497

srsgores opened this issue Apr 14, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@srsgores
Copy link

Deploying code-server to a nested URL such as /code will result in assets being requested from /, when they should be /code.

The HTML source code references root-level assets:

<script type="text/javascript" src="main.js"></script>

We should, instead, allow users to specify if they are hosting on a nested URL like /code, thus appending the host to the HTML:

./code-server --host=0.0.0.0/code
<script type="text/javascript" src="/code/main.js"></script>

Reproduction Steps

  1. Deploy to a URL like /code, or /johhny/codes
  2. Start code server
  3. Visit the URL, and observe that assets are not requested from the desired URL (code), but instead, are requested from the root / URL
@srsgores srsgores added the bug Something isn't working label Apr 14, 2019
@RyanEwen
Copy link

Came here to report the same thing when reverse proxying with NGINX to /code

@code-asher
Copy link
Member

Paths are relative now.

@RyanEwen
Copy link

Awesome. How do we specify the URL?

@code-asher
Copy link
Member

It's relative, so you don't need to specify anything. If code server is available at /code, resource requests will go to /code/resource, for example.

@RyanEwen
Copy link

RyanEwen commented Apr 30, 2019

I just wanted to report that this does work, however if not logged in I get redirected away from my /code/ to /login/ which doesn't exist (should be /code/login/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants