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

Improve --proxy-domain documentation

Open code-asher opened this issue 1 year ago • 5 comments

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.

https://github.com/coder/code-server/issues/6353#issuecomment-1656138464

code-asher avatar Jul 12 '24 23:07 code-asher

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.

code-asher avatar Jul 31 '24 19:07 code-asher

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

1AbdulkarimMousa avatar Aug 01 '24 11:08 1AbdulkarimMousa

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 .

1AbdulkarimMousa avatar Aug 01 '24 16:08 1AbdulkarimMousa

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.

code-asher avatar Aug 02 '24 18:08 code-asher

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 .

1AbdulkarimMousa avatar Aug 05 '24 00:08 1AbdulkarimMousa