umap/docs
Yohan Boniface c4bdb04795 Use X-Accel-Redirect for serving ajax-proxy request
uMap allows to use remote URL as data sources, but those URLs
are not always CORS open, so this is why there is this "ajax-proxy"
feature, where the URL is passed to the backend.

Additionally, there is a caching feature, which duration is configurable
through frontend settings. Valid values are: disabled, 5 min, 1 hour,
1 day.

Initially, I wanted this to be totally handled by Nginx, but I never
found a wayt to set the proxy_cache_valid value from a query string.

Since then, at least in OSM France servers, the ajax-proxy is still
handled by a Django view, which then opens the remote URL and transfert
the data. This is not optimal. And I suppose this is what is causing
hicups on the OSM France servers lately.

This PR provides a mix option, where python deals with validating the
URL and parsing the TTL parameter, and then it passes the hand to
nginx which will serve the remote content.

So, roughtly:

- the client calls /ajax-proxy/?url=xxx&ttl=300
- python will validate the URL (not internal calls…)
- if UMAP_SENDFILE_HEADER is set, then the python returns an empty
  response with the path /proxy/http://url plus it will set the
  cache ttl through the header X-Accel-Expires
- this /proxy/ location is then handled by nginx
2023-08-24 13:41:34 +02:00
..
administration.md Improve documentation (#746) 2020-02-26 21:31:39 +01:00
changelog.md changelog 2023-08-22 15:38:20 +02:00
contributing.md From to setup.cfg+setuptools to pyproject.toml+hatch 2023-06-17 09:09:36 -04:00
custom.md Allow to customize user display name and URL slug 2023-06-16 14:59:59 +02:00
docker.md Update docs/docker.md 2023-06-29 15:26:34 +02:00
index.md add Windows install info 2020-04-26 09:34:04 -06:00
install.md Quick doc about how to upgrade 2023-06-23 18:44:06 +02:00
install_windows.md add note on developing 2020-04-28 11:28:48 -06:00
requirements.txt Use magiclink extension for changelog with links 2023-08-23 09:45:44 -04:00
settings.md Allow to configure default share and edit status 2023-08-07 08:16:49 +02:00
ubuntu.md Use X-Accel-Redirect for serving ajax-proxy request 2023-08-24 13:41:34 +02:00