You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/self-hosted/index.md
+25-1
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,30 @@ OPTIONS
89
89
}
90
90
}
91
91
```
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
92
109
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
+
93
117
### 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