Improve --proxy-domain documentation
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.comwill become{{port}}.example.com.
https://github.com/coder/code-server/issues/6353#issuecomment-1656138464
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.
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
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 .
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.
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 .