base_url configuration setting, closes #394

* base_url configuration setting
* base_url works for static assets as well
This commit is contained in:
Simon Willison 2020-03-24 17:18:43 -07:00 committed by GitHub
commit 7656fd64d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 104 additions and 28 deletions

View file

@ -228,3 +228,16 @@ Some examples:
* https://latest.datasette.io/?_context=1
* https://latest.datasette.io/fixtures?_context=1
* https://latest.datasette.io/fixtures/roadside_attractions?_context=1
.. _config_base_url:
base_url
--------
If you are running Datasette behind a proxy, it may be useful to change the root URL used for the Datasette instance.
For example, if you are sending traffic from `https://www.example.com/tools/datasette/` through to a proxied Datasette instance you may wish Datasette to use `/tools/datasette/` as its root URL.
You can do that like so::
datasette mydatabase.db --config base_url:/tools/datasette/