Notebook under application path

asked 2012-03-16 04:40:00 -0600

CarlF gravatar image

I've installed a sage notebook and I'm trying to configure it as an application on a main web server (i.e. https://servername/sage/). I've used apache mod_proxy_http to rewrite the urls and point them to https://localhost:8000/, but some are sneaking in (through javascript, I think). In an attempt to work around this, I've added mod_proxy redirects from https://servername/home/ to https://localhost:8000/home and https://servername/javascript to https://localhost:8000/javascript.

It seems like I'm doing something wrong. This approach is very clumsy, and javascript POST requests to /home/ return 405 errors (method not allowed). Is there a way to configure the sage notebook base url to be something other than "/"?

Here's the relevant snippet of my apache ssl.conf:

ProxyPass /sage/ https://localhost:8000/
ProxyPassReverse /sage/ https://localhost:8000/

ProxyPass /javascript/ https://localhost:8000/javascript/
ProxyPassReverse /javascript/ https://localhost:8000/javascript/

ProxyPass /home/ https://localhost:8000/home/
ProxyPassReverse /home/ https://localhost:8000/home/

ProxyPassReverseCookiePath /sage/ https://localhost:8000/
ProxyHTMLURLMap https://localhost:8000/ /sage/
ProxyHTMLURLMap https://localhost:8000/ /sage/

<Location /home/>
        ProxyPassReverse /

<Location /sage/>
        ProxyPassReverse /
        ProxyHTMLEnable On
        ProxyHTMLURLMap / /sage/
        RequestHeader unset Accept-Encoding
# /my-gateway/
edit retag flag offensive close merge delete