mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
Closes #13434 Supersedes #14182 --------- Co-authored-by: Ethan <39577870+ethanndickson@users.noreply.github.com> Co-authored-by: Ethan Dickson <ethan@coder.com> Co-authored-by: Ben Potter <ben@coder.com> Co-authored-by: Stephen Kirby <58410745+stirby@users.noreply.github.com> Co-authored-by: Stephen Kirby <me@skirby.dev> Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Co-authored-by: Edward Angert <EdwardAngert@users.noreply.github.com>
29 lines
955 B
Plaintext
29 lines
955 B
Plaintext
# Redirect HTTP to HTTPS
|
|
<VirtualHost *:80>
|
|
ServerName coder.example.com
|
|
ServerAlias *.coder.example.com
|
|
Redirect permanent / https://coder.example.com/
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:443>
|
|
ServerName coder.example.com
|
|
ServerAlias *.coder.example.com
|
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
|
|
ProxyPass / http://127.0.0.1:3000/ upgrade=any # required for websockets
|
|
ProxyPassReverse / http://127.0.0.1:3000/
|
|
ProxyRequests Off
|
|
ProxyPreserveHost On
|
|
|
|
RewriteEngine On
|
|
# Websockets are required for workspace connectivity
|
|
RewriteCond %{HTTP:Connection} Upgrade [NC]
|
|
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
|
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]
|
|
|
|
SSLCertificateFile /etc/letsencrypt/live/coder.example.com/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/coder.example.com/privkey.pem
|
|
</VirtualHost>
|
|
|