I have already gone through some previous threads: How do I set subdirectory in nginx with Django how to deploy django under a suburl behind nginx Serving flask app on subdirect
First of all, remove uwsgi_modifier1 30;
. Django will handle SCRIPT_NAME
by itself and don't need to have PATH_INFO
rewritten by uWSGI. It can be harmful if SCRIPT_NAME
isn't removed from headers by uWSGI.
Secondly, remove uwsgi_param PATH_INFO "$1";
from nginx config. PATH_INFO
is already defined in uwsgi_params file, and it should be $document_uri
(as it is in uwsgi_params), not $1
if you're passing SCRIPT_NAME
to django.
After that tweaks, django should treat SCRIPT_NAME
as URL prefix and will adjust url dispatcher and url reversing to that.