[Django]-Nginx Config for 2 django applications 2 different endpoints 1 server host

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.

Leave a comment