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

Andrey Petrov shazow at gmail.com
Tue Jul 6 23:35:01 CEST 2010


The problem can be recreated by doing:

return redirect(url('/'))


With SCRIPT_NAME being "/", the URL that url('/') generates is '//'. This
makes redirect('//') get confused and do infinite redirects.

A workaround is to always use absolute (qualified) urls, such as:

return redirect(url('/', qualified=True))


Or even:

return redirect('/')

Works too.

- Andrey

On Mon, Jul 5, 2010 at 12:31 AM, Roberto De Ioris <roberto at unbit.it> wrote:

>
> Il giorno 04/lug/2010, alle ore 08.29, Andrey Petrov ha scritto:
>
> > Ah I figured out my logging issue. Changed my DynamicApps wsgi loader
> module to have this at the top:
> >
> > import logging.config
> > logging.config.fileConfig('/var/lib/wsgi/src/myproject/staging.ini')
> >
> > I was assuming this would be done by paste.deploy.loadapp but I was
> wrong.
> >
>
> This is important even for the --paste loader, i will add an option for it.
>
> By the way, i am interested in the pylons code that generate the redirect
> loop, can you post it ?
>
> --
> Roberto De Ioris
> http://unbit.it
> JID: roberto at jabber.unbit.it
>
> _______________________________________________
> uWSGI mailing list
> uWSGI at lists.unbit.it
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.unbit.it/pipermail/uwsgi/attachments/20100706/dbea22f9/attachment.htm 


More information about the uWSGI mailing list