Skip to content

Commit e3a4861

Browse files
authored
docs: update example coder.conf file (coder#6319)
Updated example configuration file to match the configuration in tutorial.
1 parent ea7a80c commit e3a4861

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

examples/web-server/apache/coder.conf

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
<VirtualHost *:80>
2-
ServerName coder.example.com
3-
ServerAlias *.coder.example.com
4-
<Location "/">
5-
Redirect permanent "https://%{HTTP_HOST}%{REQUEST_URI}"
6-
</Location>
7-
</VirtualHost>
1+
# Redirect HTTP to HTTPS
2+
<VirtualHost *:80>
3+
ServerName coder.example.com
4+
ServerAlias *.coder.example.com
5+
Redirect permanent / https://coder.example.com/
6+
</VirtualHost>
87

9-
<VirtualHost *:443>
10-
ServerName coder.example.com
11-
ServerAlias *.coder.example.com
12-
ErrorLog ${APACHE_LOG_DIR}/error.log
13-
CustomLog ${APACHE_LOG_DIR}/access.log combined
8+
<VirtualHost *:443>
9+
ServerName coder.example.com
10+
ServerAlias *.coder.example.com
11+
ErrorLog ${APACHE_LOG_DIR}/error.log
12+
CustomLog ${APACHE_LOG_DIR}/access.log combined
1413

15-
ProxyPass / http://127.0.0.1:3000/
16-
ProxyPassReverse / http://127.0.0.1:3000/
17-
ProxyRequests Off
18-
ProxyPreserveHost On
14+
ProxyPass / http://127.0.0.1:3000/ upgrade=any # required for websockets
15+
ProxyPassReverse / http://127.0.0.1:3000/
16+
ProxyRequests Off
17+
ProxyPreserveHost On
1918

20-
RewriteEngine On
21-
RewriteCond %{HTTP:Connection} Upgrade [NC]
22-
RewriteCond %{HTTP:Upgrade} websocket [NC]
23-
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]
24-
25-
SSLCertificateFile /etc/letsencrypt/live/coder.example.com/fullchain.pem
26-
SSLCertificateKeyFile /etc/letsencrypt/live/coder.example.com/privkey.pem
27-
</VirtualHost>
19+
RewriteEngine On
20+
# Websockets are required for workspace connectivity
21+
RewriteCond %{HTTP:Connection} Upgrade [NC]
22+
RewriteCond %{HTTP:Upgrade} websocket [NC]
23+
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]
2824

25+
SSLCertificateFile /etc/letsencrypt/live/coder.example.com/fullchain.pem
26+
SSLCertificateKeyFile /etc/letsencrypt/live/coder.example.com/privkey.pem
27+
</VirtualHost>
28+

0 commit comments

Comments
 (0)