[uWSGI] nginx+uwsgi problem: Can't set empy SCRIPT_NAME param

Roberto De Ioris roberto at unbit.it
Sat Jul 3 09:30:33 CEST 2010


Il giorno 03/lug/2010, alle ore 01.30, Andrey Petrov ha scritto:

> Hi, I'm deploying my Pylons application on Nginx using uwsgi, and I'm trying to set an empty SCRIPT_NAME because otherwise my Pylons application prepends an extra / in front of all non-absolute URLs.
> 
> Here is the relevant part of the configuration:
> 
> server {
>         ...
> 
>         location / {
>                 root    /var/lib/wsgi/;
>                 uwsgi_pass   unix:///tmp/uwsgi.sock;
>                 uwsgi_param UWSGI_SCRIPT wsgi;
>                 uwsgi_param SCRIPT_NAME /;
>                 include        uwsgi_params;
>         }
> }
> 
> When I try to remove the SCRIPT_NAME param or set it to SCRIPT_NAME "";, Nginx stops serving the app with this error: "wsgi application not found"


Do you really need dynamic apps ?

To run pylons apps you can simply use:

http://projects.unbit.it/uwsgi/wiki/UsePaste

Dynamic apps requires a valid (non-empty) SCRIPT_NAME, so if you do not specify it,
your app will be simply not loaded (infact you receive an app-not-found error)

Your solution is good as DynamicApps allows funny configurations, and your tecnic is one of those that allow to bypass
WSGI/uWSGI/webservers limits with a very little overhead.

By the way, i am investigating the possibility (and implications) of mapping zero-size SCRIPT_NAME to the default app
in DynamicApps mode

--
Roberto De Ioris
http://unbit.it
JID: roberto at jabber.unbit.it



More information about the uWSGI mailing list