Problem with uWSGI and PATH_INFO
Etienne Robillard
tkadm30 at yandex.com
Thu Jul 27 14:20:09 UTC 2017
Hi Roberto,
Le 2017-07-27 à 09:52, Roberto De Ioris a écrit :
>
>> Hi again, this is not what manage-script-name is for. It is a
>> uWSGI-specific option for when you only PATH_INFO and you want to generate
>> SCRIPT_NAME accordingly. This requires to "mount" apps under specific
>> paths.
Ok. I really don't want to "mount" my app under a specific script name.
>> uWSGI by itself does not rewrite the vars passed by the webserver, if you
>> want to do it you have to use internal routing accordingly (or use a WSGI
>> middleware that is generally more handy and portable, albeit annoying if
>> you already have an entry point)
Nginx internal routing seems a reasonable choice here. My app is looking
like this:
dispatch-django.uwsgi:
def application(environ, start_response):
wsgi_app = make_app()
return wsgi_app(environ, start_response)
Then I invoke uwsgi like so:
% uwsgi --socket localhost:8000 --wsgi-file dispatch-django.uwsgi
--daemonize /var/log/uwsgi.log --enable-threads --workers 2
I think there's really something wrong with uWSGI internal routing
system. The so-called "mountpoints" seems a little obscure to me.
Perhaps the documentation should define a method to mount a dynamic
django app without the need of --manage-script-name ?
Etienne
--
Etienne Robillard
tkadm30 at yandex.com
http://www.isotopesoftware.ca/
More information about the nginx
mailing list