Skip to content
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

Improve --proxy-domain documentation #6897

Open
code-asher opened this issue Jul 12, 2024 · 5 comments
Open

Improve --proxy-domain documentation #6897

code-asher opened this issue Jul 12, 2024 · 5 comments
Labels
docs Documentation related

Comments

@code-asher
Copy link
Member

code-asher commented Jul 12, 2024

Yeah we should update that section to say you can use {{port}}
and {{host}}. If you do not include {{port}} then code-server
prepends it for you. So --domain-proxy example.com will become
{{port}}.example.com.

#6353 (comment)

@code-asher code-asher added the docs Documentation related label Jul 12, 2024
@code-asher
Copy link
Member Author

code-asher commented Jul 31, 2024

This feature is for proxying any arbitrary port dynamically for the purposes of web development, so it has to be a number. If it was not a number you would need something to map words to the right port number.

As one example, if you have code-server hosted at http://my-code-server.com and you are developing a PHP application on port 8080, you can browse http://8080.my-code-server.com to view and test the application you are developing.

It is entirely opt-in though, so you do not have to use it. You can use the path-based proxy instead (http://my-code-server.com/proxy/8080), or forward the port with SSH, or do something else.

@1AbdulKareem
Copy link

1AbdulKareem commented Aug 1, 2024

for proxy & reverse proxy and for cloud services it's better for it to be mapped as unix socket instead of TCP/IP socket ? why it's implemented mainly to send back responses from 8080.my-code-server.com ? . I had to do extra coding to alter source packets in between nginx and code-server to fix the white screen in the code-server .

it will be a lot better to have two channels : one for my-code-server.com , the second is my-code-server.com

correct me please if there is a way to have my-code-server.com only

@1AbdulKareem
Copy link

1AbdulKareem commented Aug 1, 2024

by default the code-server --proxy-domain must be given only the domain name . if I want to make another instance I will start another process of code-server on another port with that domain .

@code-asher
Copy link
Member Author

code-asher commented Aug 2, 2024

You would not need a second instance, and you should not need to alter any packets.

--proxy-domain my-code-server.com will serve code-server just like normal when you visit https://my-code-server.com. In addition, it will also proxy any port at https://$port.my-code-server.com`.

If you add --proxy-domain my-code-server.com and going to https://my-code-server.com does not show code-server, then that is definitely a bug and we need to fix it.

In your case, it sounds like you do not need the port proxy at all. So I would just remove --proxy-domain; this flag is not required to put code-server behind a different reverse proxy like NGINX, it only enables code-server's own built-in proxy for ports.

@1AbdulKareem
Copy link

I tried each option behind reverse proxy and no luck . I got white screen . I'll install it on a clean ubuntu machine and post steps of how to reproduce the problem .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related
Projects
None yet
Development

No branches or pull requests

2 participants