mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs: add apache reverse-proxy example (#6213)
* docs: apache reverse proxy * fixed to correctly pass WebSocket headers * add a sample configuration file * updating with suggestions * Update coder.conf * fix http to https redirection * fix: upgrade http to https * Update examples/web-server/apache/README.md Co-authored-by: Ben Potter <me@bpmct.net> * add other dns providers documentation link --------- Co-authored-by: Ben Potter <me@bpmct.net> Co-authored-by: Ben Potter <ben@coder.com>
This commit is contained in:
co-authored by
Ben Potter
Ben Potter
parent
99306642bb
commit
26876dc734
@@ -0,0 +1,28 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName coder.example.com
|
||||
ServerAlias *.coder.example.com
|
||||
<Location "/">
|
||||
Redirect permanent "https://%{HTTP_HOST}%{REQUEST_URI}"
|
||||
</Location>
|
||||
</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/
|
||||
ProxyPassReverse / http://127.0.0.1:3000/
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
|
||||
RewriteEngine On
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user