anru/rsted — pull request #30 by markuslindenberg (2014-06-27 13:44:12+00:00)
Title: use script_root in absolute links to support subdirectory URLs

Hi,

we needed to install rsted in a sublocation ( foo.com/rsted/ ) and with https enabled. So I did a few changes:

* Change Templates to use `request.script_root` in absolute paths
* Set `request.script_root` as a Javascript variable `script_root` in global context in `base.html`
* Use `script_root` for URLs generated in Javascript
* Use `//...` instead of `http://..` to make links protocol agnostic and support https.

Our Nginx configuration for running rsted as `/rsted/` using uWSGI looks like this:

```
location /rsted {
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi/app/rsted/socket;
uwsgi_param SCRIPT_NAME /rsted;
uwsgi_modifier1 30;
}
```

Thanks for that awesome piece of software.