Problem with uWSGI and PATH_INFO

Etienne Robillard tkadm30 at yandex.com
Thu Jul 27 13:18:48 UTC 2017


Hi Roberto,

I use gevent-fastcgi for production. I wish to have the time to dive in 
the internals of uWSGI to understand how PATH_INFO and SCRIPT_NAME gets 
rewritten by uWSGI. I believe the implementation of --manage-script-name 
is incorrect and should be fixed to support having a empty or not set 
SCRIPT_NAME value.

Etienne


Le 2017-07-27 à 09:01, Roberto De Ioris a écrit :
>> Hi,
>>
>> if the url is something like /foo/bar and you have a location like
>>
>> location /foo {
>>      ...
>> }
>>
>> the WSGI standard expects SCRIPT_NAME to be /foo and PATH_INFO to be /bar
>>
>> if you manually set SCRIPT_NAME to /foo in nginx, PATH_INFO will continue
>> to be /foo/bar.
>>
>> Obviously having nginx managing it could be useful, but nowadays it is way
>> more versatile to manage this part in uWSGI itself (using the
>> manage-script-name or internal routing to manually rewrite apps), or
>> directly in your WSGI middleware.
>>
>> your fastcgi adapter (i suppose flup) hardcodes this magic using the
>> classic apache fastcgi patterns (something we cannot rely on as we need to
>> support multiple environments)
>>

-- 
Etienne Robillard
tkadm30 at yandex.com
http://www.isotopesoftware.ca/



More information about the nginx mailing list