Skip to content

Start code-server with the --proxy-domain flag set to your domain. #1523

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
cstrat opened this issue Apr 14, 2020 · 3 comments
Closed

Start code-server with the --proxy-domain flag set to your domain. #1523

cstrat opened this issue Apr 14, 2020 · 3 comments

Comments

@cstrat
Copy link

cstrat commented Apr 14, 2020

Apologies, this is more a question about Docker. However the updated FAQ doesn't really help me out here, hopefully someone can help me out and maybe add some more info to the FAQ.

ref: https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-do-i-securely-access-web-services

I have a docker-compose file which builds my code-server instance.
How do I set this flag in my docker-compose file?
I tried setting an environment variable (like the code-server password) but that didn't work.

Right now I am not able to login to code-server because the cookie is being set to my servers local LAN IP so I can't re-authenticate. This all worked fine prior to 3.1.0

image

I can manually add the cookie and it works fine... it is just not getting set correctly because I can't configure the domain.

@kylecarbs
Copy link
Member

Not sure what you mean. I'll give you an example of how to set it up:

DNS record code-server.org points to my server 1.1.1.1.

DNS record 3000.code-server.org also points to my server 1.1.1.1.

code-server --proxy-domain *.code-server.org will forward 3000, or any port in that subdomain to the requested port on your server, all behind code-server auth.

Happy to elaborate, just let me know!

@cstrat
Copy link
Author

cstrat commented Apr 14, 2020

Hi Kyle - Thanks, yes I understand how it all works. I’ve had it working fine prior to 3.1.

I just don’t know how to add the proxy domain flag to a docker image? I’m not running the executable myself - docker is. Unsure where the flag needs to go. Do you use docker-compose?

@cstrat
Copy link
Author

cstrat commented Apr 14, 2020

Ahh forget it @kylecarbs - I just saw this in another closed issue.

#1507 (comment)

I just needed to update my nginx config to pass on the host header, no need to worry about the proxy-domain argument.

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

No branches or pull requests

2 participants