Skip to content

Commit d3164fc

Browse files
authored
Merge pull request #1867 from Niek/patch-1
Add Nginx instructions to guide
2 parents 4727385 + 6c5a9ed commit d3164fc

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

doc/guide.md

+23
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,29 @@ To avoid the warnings, you can use [mkcert](https://mkcert.dev) to create a self
244244
trusted by your OS and then pass it into `code-server` via the `cert` and `cert-key` config
245245
fields.
246246

247+
### Nginx reverse proxy
248+
249+
If you prefer to use Nginx instead of Caddy here is a sample config (put e.g. in
250+
`/etc/nginx/sites-enabled/code-server`):
251+
252+
```nginx
253+
server {
254+
listen 80 [::]:80;
255+
server_name your-domain-name-here.com;
256+
257+
location / {
258+
proxy_pass http://127.0.0.1:8080/;
259+
proxy_set_header Host $host;
260+
proxy_set_header Upgrade $http_upgrade;
261+
proxy_set_header Connection upgrade;
262+
proxy_set_header Accept-Encoding gzip;
263+
}
264+
}
265+
```
266+
267+
It's highly recommended to set up a LetsEncrypt certificate and HTTP->HTTPS redirect as well.
268+
In order to do this run `certbot --nginx -d your-domain-name-here.com`.
269+
247270
### Change the password?
248271

249272
Edit the `password` field in the `code-server` config file at `~/.config/code-server/config.yaml`

0 commit comments

Comments
 (0)