From 75435be9491494089f2b8ad9e815287894b101f8 Mon Sep 17 00:00:00 2001 From: Dominik Schenner Date: Thu, 21 Mar 2019 19:49:27 +0100 Subject: [PATCH] Update index.md (#297) Added Apache reverse proxy example configuration --- doc/self-hosted/index.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/self-hosted/index.md b/doc/self-hosted/index.md index 742d9ebe..594c8c91 100644 --- a/doc/self-hosted/index.md +++ b/doc/self-hosted/index.md @@ -89,6 +89,30 @@ OPTIONS } } ``` + + ### 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. + ``` + + ServerName code.example.com + RewriteEngine On + RewriteCond %{HTTP:Upgrade} =websocket [NC] + RewriteRule /(.*) ws://localhost:8443/$1 [P,L] + RewriteCond %{HTTP:Upgrade} !=websocket [NC] + RewriteRule /(.*) http://localhost:8443/$1 [P,L] + + ProxyRequests off + + RequestHeader set X-Forwarded-Proto https + RequestHeader set X-Forwarded-Port 443 + + ProxyPass / http://localhost:8443/ nocanon + ProxyPassReverse / http://localhost:8443/ + + + ``` + *Important:* For more details about Apache reverse proxy configuration checkout the [documentation](https://httpd.apache.org/docs/current/mod/mod_proxy.html) - especially the [Securing your Server](https://httpd.apache.org/docs/current/mod/mod_proxy.html#access) section + ### Help - Use `code-server -h` or `code-server --help` to view the usage for the cli. This is also shown at the beginning of this section. + Use `code-server -h` or `code-server --help` to view the usage for the cli. This is also shown at the beginning of this section.