-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjupyter_proxy.conf
26 lines (22 loc) · 984 Bytes
/
jupyter_proxy.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<VirtualHost _default_:443>
SSLEngine On
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
ProxyRequests Off
ProxyPreserveHost On
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /EC2_INSTANCE_ID/(.*) ws://NOTEBOOK_HOST:8888/EC2_INSTANCE_ID/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /EC2_INSTANCE_ID/(.*) http://NOTEBOOK_HOST:8888/EC2_INSTANCE_ID/$1 [P,L]
<Location /EC2_INSTANCE_ID/ >
AddHandler mod_python .py
PythonPath "sys.path+['/usr/lib/cgi-bin']"
PythonHeaderParserHandler access
PythonInterpreter main_interpreter
ProxyPass http://NOTEBOOK_HOST:8888/EC2_INSTANCE_ID/
</Location>
# https://httpd.apache.org/docs/current/mod/mod_log_config.html
LogFormat "%t %{ms}T %P %{tid}P %k %h \"%r\" %>s %b %U" proxy-access-log-format
CustomLog ${APACHE_LOG_DIR}/proxy-access.log proxy-access-log-format
</VirtualHost>