Skip to content

code-server through nginx proxies #1214

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
bdotsamir opened this issue Dec 8, 2019 · 1 comment
Closed

code-server through nginx proxies #1214

bdotsamir opened this issue Dec 8, 2019 · 1 comment

Comments

@bdotsamir
Copy link

Description

Hi everyone, I'm in a bit of a pickle.

Picture this, I have a website. For transparency I'll just use my actual domain, akii.dev.
I have said website running on an nginx instance on a raspberry pi.

I would like to add code-server, except I want it running on my local computer instead of my raspberry pi. Shouldn't be an issue, right?

server {
  listen 80;
  server_name code.akii.dev;

  location / {
    proxy_pass https://192.168.1.xxx:8080;
  }
}

And in response, Firefox says:
image

My predicament is as follows: .dev domains require https. When I start code server with --cert so it has its own self-signed cert, the HSTS issue appears. When i start code server without --cert the HSTS issue appears.

Now normally this wouldn't be an issue, however I can't seem to get certbot working for some odd reason. Whenever I try, it gives me this:
image

I am in multiple layers of "what the hell do I do now". Any help would be greatly appreciated.

Possible related issues:

#80

@bdotsamir
Copy link
Author

bdotsamir commented Dec 8, 2019

Ok! Not sure how I did it, but I used a cert that I generated earlier.. I'm not sure when I did it and how I did but hey I did it.

I changed the port to listen on to 443 and added in the certs, then I used the proxy info from doc/quickstart.md and it all worked.

server {
  listen 443;
  listen [::]:443;
  server_name code.akii.dev;

  location / {
    proxy_pass http://192.168.1.xxx:8080;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Accept-Encoding gzip;
  }

  ssl on;
  ssl_certificate /cert/path;
  ssl_certificate_key /key/path;
}

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

1 participant