2👍
✅
Are you using gunicorn as WSGI server ?
In case, try adding this to the existing nginx configuration:
location /api {
proxy_set_header SCRIPT_NAME /api;
...
location /data {
proxy_set_header SCRIPT_NAME /data;
...
...
In principle, SCRIPT_NAME will be passed to gunicorn, which in turn should use it as a prefix in all addresses.
I never tried this in a real project, though.
Source:stackexchange.com