From 96af9761b7007d7e9b0e6f99d039e1baa29168ae Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Mon, 6 Jul 2020 10:45:09 +0200 Subject: [PATCH 1/3] Add Nginx instructions to guide Added Nginx instructions for people who prefer to use this instead of Caddy --- doc/guide.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/guide.md b/doc/guide.md index 0b7b3423..15e93aed 100644 --- a/doc/guide.md +++ b/doc/guide.md @@ -244,6 +244,25 @@ To avoid the warnings, you can use [mkcert](https://mkcert.dev) to create a self trusted by your OS and then pass it into `code-server` via the `cert` and `cert-key` config fields. +### Nginx reverse proxy + +If you prefer to use Nginx instead of Caddy, here is a sample config (put e.g. in `/etc/nginx/sites-enabled/code-server`): +```nginx +server { + listen 80 [::]:80; + server_name your-domain-name-here.com; + + location / { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + proxy_set_header Accept-Encoding gzip; + } +} +``` +It's highly recommended set up a LetsEncrypt certificate and HTTP->HTTPS redirect as well. In order to do this, run `certbot --nginx -d your-domain-name-here.com`. + ### Change the password? Edit the `password` field in the `code-server` config file at `~/.config/code-server/config.yaml` From 6c3e4d2a76862792216dd1ff6e75411511fb9fb1 Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Thu, 16 Jul 2020 19:24:13 +0200 Subject: [PATCH 2/3] Add trailing / --- doc/guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guide.md b/doc/guide.md index 15e93aed..127615ea 100644 --- a/doc/guide.md +++ b/doc/guide.md @@ -253,7 +253,7 @@ server { server_name your-domain-name-here.com; location / { - proxy_pass http://127.0.0.1:8080; + proxy_pass http://127.0.0.1:8080/; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; From 6c5a9edced83dc0440bc6c09677497635b2f122d Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 21 Jul 2020 17:16:32 -0500 Subject: [PATCH 3/3] Tiny text changes --- doc/guide.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/guide.md b/doc/guide.md index 127615ea..ba47811a 100644 --- a/doc/guide.md +++ b/doc/guide.md @@ -246,7 +246,9 @@ fields. ### Nginx reverse proxy -If you prefer to use Nginx instead of Caddy, here is a sample config (put e.g. in `/etc/nginx/sites-enabled/code-server`): +If you prefer to use Nginx instead of Caddy here is a sample config (put e.g. in +`/etc/nginx/sites-enabled/code-server`): + ```nginx server { listen 80 [::]:80; @@ -261,7 +263,9 @@ server { } } ``` -It's highly recommended set up a LetsEncrypt certificate and HTTP->HTTPS redirect as well. In order to do this, run `certbot --nginx -d your-domain-name-here.com`. + +It's highly recommended to set up a LetsEncrypt certificate and HTTP->HTTPS redirect as well. +In order to do this run `certbot --nginx -d your-domain-name-here.com`. ### Change the password?