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-22
Original file line number
Diff line number
Diff line change
@@ -38,21 +38,24 @@ Usage: code-server [options]
38
38
Run VS Code on a remote server.
39
39
40
40
Options:
41
-
-V, --version output the version number
41
+
-V, --version output the version number
42
42
--cert <value>
43
43
--cert-key <value>
44
-
-e, --extensions-dir <dir> Set the root path for extensions.
45
-
-d, --user-data-dir <dir> Specifies the directory that user data is kept in, useful when running as root.
46
-
--data-dir <value> DEPRECATED: Use '--user-data-dir' instead. Customize where user-data is stored.
47
-
-h, --host <value> Customize the hostname. (default: "0.0.0.0")
48
-
-o, --open Open in the browser on startup.
49
-
-p, --port <number> Port to bind on. (default: 8443)
50
-
-N, --no-auth Start without requiring authentication.
51
-
-H, --allow-http Allow http connections.
52
-
-P, --password <value> Specify a password for authentication.
53
-
--disable-telemetry Disables ALL telemetry.
54
-
--help output usage information
55
-
```
44
+
-e, --extensions-dir <dir> Override the main default path for user extensions.
45
+
--extra-extensions-dir [dir] Path to an extra user extension directory (repeatable). (default: [])
46
+
--extra-builtin-extensions-dir [dir] Path to an extra built-in extension directory (repeatable). (default: [])
47
+
-d, --user-data-dir <dir> Specifies the directory that user data is kept in, useful when running as root.
48
+
-h, --host <value> Customize the hostname. (default: "0.0.0.0")
49
+
-o, --open Open in the browser on startup.
50
+
-p, --port <number> Port to bind on. (default: 8443)
51
+
-N, --no-auth Start without requiring authentication.
52
+
-H, --allow-http Allow http connections.
53
+
--disable-telemetry Disables ALL telemetry.
54
+
--socket <value> Listen on a UNIX socket. Host and port will be ignored when set.
55
+
--trust-proxy Trust the X-Forwarded-For header, useful when using a reverse proxy.
56
+
--install-extension <value> Install an extension by its ID.
57
+
-h, --help output usage information
58
+
```
56
59
57
60
### Data Directory
58
61
Use `code-server -d (path/to/directory)` or `code-server --user-data-dir=(path/to/directory)`, excluding the parentheses to specify the root folder that VS Code will start in.
@@ -79,23 +82,23 @@ Options:
79
82
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
80
83
81
84
### Nginx Reverse Proxy
82
-
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.
85
+
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.
83
86
```
84
87
server {
85
88
listen 80;
86
89
listen [::]:80;
87
90
server_name code.example.com code.example.org;
88
-
location / {
89
-
proxy_pass http://localhost:8443/;
90
-
proxy_set_header Upgrade $http_upgrade;
91
-
proxy_set_header Connection upgrade;
92
-
proxy_set_header Accept-Encoding gzip;
93
-
}
94
-
}
91
+
location / {
92
+
proxy_pass http://localhost:8443/;
93
+
proxy_set_header Upgrade $http_upgrade;
94
+
proxy_set_header Connection upgrade;
95
+
proxy_set_header Accept-Encoding gzip;
96
+
}
97
+
}
95
98
```
96
99
97
100
### Apache Reverse Proxy
98
-
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.
101
+
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.
0 commit comments