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

Andrey Petrov shazow at gmail.com
Wed Jul 7 23:26:54 CEST 2010


Hi Roberto, thank you *very much* for your work! I'm very excited to try
this. I'll let you know as soon as I do (hopefully this week).

- Andrey

On Wed, Jul 7, 2010 at 2:55 AM, Roberto De Ioris <roberto at unbit.it> wrote:

>
> Il giorno 06/lug/2010, alle ore 23.35, Andrey Petrov ha scritto:
>
> > 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:
>
>
> Hi Andrey, i have managed to reproduce the problem, and i have modified the
> SCRIPT_NAME handling of the wsgi
> core.
>
> First of all the PEP 333 says that if the app is mounted in the root,
> SCRIPT_NAME can be (read: can be) empty (but not undefined).
>
> So for me
>
> SCRIPT_NAME  ""
>
> and
>
> SCRIPT_NAME "/"
>
> are two different beasts
>
> Someone is against this statement ?
>
> Having said that, SCRIPT_NAME "" and "/" will map to the same app
> internally (the default app 0), but dynamic apps
> can be defined even with an empty SCRIPT_NAME
>
> This will maintain backward compatibility and allow pylons apps to work out
> of the box (i hope)
>
> Please clone the current mercurial repository, and retry in DynamicApps
> mode and with  --paste defining SCRIPT_NAME as ""
> (paste wants a SCRIPT_NAME defined). If both works flawlessly i will
> backport this modification to the stable versions.
>
> Thanks for your support
>
> --
> 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/20100707/3a9a51c9/attachment.htm 


More information about the uWSGI mailing list