From e776f1819231207b1c84da5124188485207081f4 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 11 Jul 2019 12:30:42 +1000 Subject: [PATCH] update docs to mention --trust-proxy --- doc/self-hosted/index.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/self-hosted/index.md b/doc/self-hosted/index.md index e75d8809..0a1b20e0 100644 --- a/doc/self-hosted/index.md +++ b/doc/self-hosted/index.md @@ -82,23 +82,23 @@ Options: > To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md) ### Nginx Reverse Proxy - Nginx is for reverse proxy. Below is a virtual host example that works with code-server. Please also pass --allow-http. You can also use certbot by EFF to get a ssl certificates for free. + Below is a virtual host example that works with code-server. Please also pass `--allow-http` and `--trust-proxy` to code-server to allow the proxy to connect. You can also use Let's Encrypt to get a SSL certificates for free. ``` server { listen 80; listen [::]:80; server_name code.example.com code.example.org; - location / { - proxy_pass http://localhost:8443/; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection upgrade; - proxy_set_header Accept-Encoding gzip; - } - } + location / { + proxy_pass http://localhost:8443/; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + proxy_set_header Accept-Encoding gzip; + } + } ``` ### Apache Reverse Proxy - Example of https virtualhost configuration for Apache as a reverse proxy. Please also pass --allow-http on code-server startup to allow the proxy to connect. + Example of a HTTPS virtualhost configuration for Apache as a reverse proxy. Please also pass `--allow-http` and `--trust-proxy` to code-server to allow the proxy to connect. You can also use Let's Encrypt to get a SSL certificates for free. ``` ServerName code.example.com