<VirtualHost *:443>
ServerName jupyter.kwain.net
ServerAdmin jflesch@kwain.net

DocumentRoot /var/www/html

# Fix for "SSL input filter read failed"
SetEnv nokeepalive

RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://jupyterlab.home:8888/$1 [P,L]

ProxyPass         / http://jupyterlab.home:8888/
ProxyPassReverse  / http://jupyterlab.home:8888/

ProxyPreserveHost On

SSLEngine on
Protocols h2 http/1.1

ErrorLog ${APACHE_LOG_DIR}/jupyter_error.log
CustomLog ${APACHE_LOG_DIR}/jupyter_access.log vhost_combined

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>

BrowserMatch "MSIE [2-6]"nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]"ssl-unclean-shutdown

Include    /etc/apache2/options-ssl-apache.conf
SSLCertificateFile /etc/apache2/certs/fullchain.pem
SSLCertificateKeyFile /etc/apache2/certs/privkey.key
</VirtualHost>
