Skip to content

Commit 75435be

Browse files
Dominik Schennerkylecarbs
Dominik Schenner
authored andcommitted
Update index.md (#297)
Added Apache reverse proxy example configuration
1 parent ce73bc5 commit 75435be

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

doc/self-hosted/index.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,30 @@ OPTIONS
8989
}
9090
}
9191
```
92+
93+
### Apache Reverse Proxy
94+
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.
95+
```
96+
<VirtualHost *:80>
97+
ServerName code.example.com
98+
99+
RewriteEngine On
100+
RewriteCond %{HTTP:Upgrade} =websocket [NC]
101+
RewriteRule /(.*) ws://localhost:8443/$1 [P,L]
102+
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
103+
RewriteRule /(.*) http://localhost:8443/$1 [P,L]
104+
105+
ProxyRequests off
106+
107+
RequestHeader set X-Forwarded-Proto https
108+
RequestHeader set X-Forwarded-Port 443
92109
110+
ProxyPass / http://localhost:8443/ nocanon
111+
ProxyPassReverse / http://localhost:8443/
112+
113+
</VirtualHost>
114+
```
115+
*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
116+
93117
### Help
94-
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.
118+
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.

0 commit comments

Comments
 (0)