jupyter notebook websockets in aws

<virtualhost *:80>
  ProxyPreserveHost On
  ProxyRequests Off

  ServerName notebook.your-domain.com

  # redirect all requests to https
  RewriteEngine On
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
  SetEnv HTTPS 1

  # allow web-sockets
  RewriteEngine On
  RewriteCond %{HTTP:Upgrade} =websocket [NC]
  RewriteRule /(.*)           ws://localhost:8888/$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  RewriteRule /(.*)           http://localhost:8888/$1 [P,L]

  # forward to specific port
  ProxyPass / http://localhost:8888/
  ProxyPassReverse / http://localhost:8888/


Some useful Linux terminal shortcuts. For increased proficiency on the shell.

CTLR + L               Clean-up the whole screen

CTRL + A               Move cursor to the beginning of the line
CTRL + E               Move cursor to the end of the line

ALT + ESC + .       display the last entered parameters