Skip to content

Add --base-path flag for use with absolute proxy #6770

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
code-asher opened this issue Apr 25, 2024 · 6 comments · Fixed by #6958
Closed

Add --base-path flag for use with absolute proxy #6770

code-asher opened this issue Apr 25, 2024 · 6 comments · Fixed by #6958
Labels
enhancement Some improvement that isn't a feature

Comments

@code-asher
Copy link
Member

This is not for code-server itself (since it works relatively), it would just be prepended to absproxy requests for applications that need the full path.

@rafaelnferreira
Copy link
Contributor

Hi @code-asher I've submitted a PR to resolve this case, could you have a look when you have a chance? Thanks

@yuzhuoheng
Copy link

abs-proxy-base-path It didn't work. This is my startup command:
企业微信截图_17288752683468
I tried to open it with a browser, and the page prompt was as follows:
企业微信截图_1728875413984

@code-asher
Copy link
Member Author

I answered in the other issue, but as mentioned above

This is not for code-server itself (since it works relatively), it would just be prepended to absproxy requests for applications that need the full path.

@code-asher
Copy link
Member Author

In other words, if you have an application on port 3000 and it requires absolute paths, and you have a reverse proxy serving code-server at /some/path, you can set --abs-proxy-base-path=/some/path, and then you can access your app with http://code-server.com/some/path/absproxy/3000.

Hope that helps!

@kimboslice99
Copy link

I think the long list of people that keep asking various questions on getting code-server to work under a base path should be a strong enough indicator that the docs are not thorough enough.

@code-asher
Copy link
Member Author

code-asher commented Feb 18, 2025

Fair. I believe it is confusing because there are potentially two proxies: the one that hosts code-server, and code-server's built-in proxy, for viewing webapps you are working on.

The base path flag is for code-server's built-in proxy. Nothing needs to be done to make code-server itself work behind another proxy, like Caddy or NGINX or so on.

We are open to PRs that clarify the docs. I think I may be too close to the source code to understand how to word them in a way that makes sense to other folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
4 participants