-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrstudio_proxy.conf
27 lines (23 loc) · 959 Bytes
/
rstudio_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
27
<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:8787/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /EC2_INSTANCE_ID/(.*) http://NOTEBOOK_HOST:8787/$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:8787/
ProxyPassReverse /
</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>