[uWSGI] Is it neccesseary to specify SCRIPT_NAME

Damjan Georgievski gdamjan at gmail.com
Sat Jul 3 18:08:17 CEST 2010

Reading http://projects.unbit.it/uwsgi/wiki/RunOnNginx there is this:

The WSGI standard says that the SCRIPT_NAME is the var used to select
a specific application. The "uwsgi_modifier1 30" option set the
UWSGI_MODIFIER_MANAGE_PATH_INFO. This per-request modifier instructs
the uWSGI server to rewrite the PATH_INFO value removing the
SCRIPT_NAME from it.

So when you use a WSGI application under a non-root URL, you must
explicitly set the SCRIPT_NAME and also set the modifier 30. Like in
the example:

        location /django {
            uwsgi_pass   uwsgicluster;
            include        uwsgi_params;
            uwsgi_param SCRIPT_NAME /django;
            uwsgi_param UWSGI_SCRIPT django_wsgi;
            uwsgi_modifier1 30;

To me it looks excessive to specify the URL twice in both "location
/django" and "uwsgi_param SCRIPT_NAME /django;"

So my question,
is it possible to get/compute SCRIPT_NAME and PATH_INFO from the nginx
module environment, so that this would work automagically?


More information about the uWSGI mailing list