Skip to content

Commit e776f18

Browse files
committed
update docs to mention --trust-proxy
1 parent c48a275 commit e776f18

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

doc/self-hosted/index.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,23 @@ Options:
8282
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
8383
8484
### Nginx Reverse Proxy
85-
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.
8686
```
8787
server {
8888
listen 80;
8989
listen [::]:80;
9090
server_name code.example.com code.example.org;
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-
}
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+
}
9898
```
9999

100100
### Apache Reverse Proxy
101-
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.
102102
```
103103
<VirtualHost *:80>
104104
ServerName code.example.com

0 commit comments

Comments
 (0)