chronodiagram/diagramming-apache-site.exa...

27 lines
748 B
Plaintext

<VirtualHost *:80>
# This is the HTTP example, ideally use Certbot/LetsEncrypt to encrypt the data transferred
Servername diagramming.WEBSITE
<Location />
# Optionally use some basic auth to prevent access to anyone.
AuthType Basic
Authname "Password Required"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Location>
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:7890/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:7890/$1 [P,L]
ProxyPass / http://localhost:7890/
ProxyPassReverse / http://localhost:7890/
ProxyPreserveHost On
</VirtualHost>