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

Andrey Petrov shazow at gmail.com
Sun Jul 4 08:14:18 CEST 2010


Ok, figured out why the error was happening. It was because I had uwsgi
0.9.5 and it had a paste bug. Installing 0.9.5.1 fixed this.

Unfortunately turns out that Paste (1.7.4) assumes that there is a
SCRIPT_NAME key (even if the value is "") and otherwise raises an exception
for any URL that isn't /. If I use --paste for uwsgi and don't supply a
SCRIPT_NAME in nginx, it breaks. So I reverted back to the DynamicApps setup
with my wsgi wrapper that removes the extraneous slash.

I still can't figure out why the logger configuration isn't being setup at
all, though.

(Also, looks like I might have accidentally hijacked another thread somehow.
Apologies if that is the case.)

- Andrey

On Sat, Jul 3, 2010 at 6:02 PM, Andrey Petrov <shazow at gmail.com> wrote:

> Do you really need dynamic apps ?
>>
>> To run pylons apps you can simply use:
>>
>> http://projects.unbit.it/uwsgi/wiki/UsePaste
>>
>
> I tried to set this up using the --paste flag, but I still get "wsgi
> application not found".
>
> Here's my uwsgi command:
>
> uwsgi -s /tmp/uwsgi.sock -H /var/lib/wsgi/ --paste
> config:/var/lib/wsgi/src/myproject/staging.ini \
> --uid 33 --gid 33 -M --pythonpath /var/lib/wsgi/src/myproject --pythonpath
> /var/lib/wsgi
>
>
> I tried various combinations of --pythonpath (with and without and pointing
> to different places like /var/lib/wsgi/lib/python-2.6/site-packages and
> such).
>
> And the nginx configuration is simply:
>
>         location / {
>                 uwsgi_pass   unix:///tmp/uwsgi.sock;
>                 include        uwsgi_params;
>         }
>
> Is there anything obvious I'm missing?
>
> Also another problem I've encountered is that my logging configurations in
> the .ini are not being respected when I run through uwsgi (as opposed
> through paster). For example, in the staging.ini, I have a logger that I
> define to write through RotatingFileHandler that I call explicitly with
> every request inside of the application but it's not getting written when
> running through uwsgi. Any thoughts on this?
>
> Excerpt from staging.ini:
>
> [loggers]
> keys = root, history
>
> ...
>
> [logger_history]
> level = DEBUG
> handlers = history
> qualname = history
>
> [handler_history]
> class = handlers.RotatingFileHandler
> args = ('/var/lib/wsgi/src/myproject/history.log','a', 20000000, 10)
> level = NOTSET
> formatter = simpler
>
>
> Thank you again and I'm looking forward to your polishing of the nginx
> uwsgi params interface (re SCRIPT_NAME). :)
>
> - Andrey
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.unbit.it/pipermail/uwsgi/attachments/20100703/55c2ab76/attachment-0001.htm 


More information about the uWSGI mailing list