uWSGI & pylons URL problem

Hi all

I tried to setup nginx with the uwgsi module to a pylons application
which runs via the uWGSI Server according to following tutorial:
http://tonylandis.com/python/deployment-howt-pylons-nginx-and-uwsgi/

However when i try to access the pylons application all links which were
created with the pylon’s url object are messed up (double slash “//” at
the beginning instead of one slash “/”)

If i use following code to generate the url for the current pylons
“page”:

${h.url.current()}

I get “//CURRENT_URL” instead of “/CURRENT_URL”

I tried it even with a fresh pylons app, to make sure that none of my
routing entries are responsible for this behavior.
It seems that the SCRIPT_NAME “/” is added at the beginning of each URL
somehow.

I don’t think my problem is related to the uWSGI Server because when i
try to access the uWSGI served pylons app via Cherokee the links are
fine.

I would be thankful for any ideas or hints.

I used following versions:

nginx: 0.8.47-0
uWSGI: 0.9.5.4
pylons: 1.0 (but same problem with 0.9.7)

Thanks in advance

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,116092,116092#msg-116092

Il giorno 03/ago/2010, alle ore 16.11, timeu ha scritto:

If i use following code to generate the url for the current pylons
It seems that the SCRIPT_NAME “/” is added at the beginning of each URL
somehow.

This is an issue signalled by Andrey Petrov and fixed in the current
mercurial repository (you can check it in the mailing list archive).

I hope to release a maintainance version of the 0.9.5 tree asap.

Roberto De Ioris
http://unbit.it
JID: [email protected]

On Tue, Aug 03, 2010 at 10:11:36AM -0400, timeu wrote:

If i use following code to generate the url for the current pylons
It seems that the SCRIPT_NAME “/” is added at the beginning of each URL
nginx: 0.8.47-0
uWSGI: 0.9.5.4
pylons: 1.0 (but same problem with 0.9.7)

Try to remove
uwsgi_param SCRIPT_NAME /;


Igor S.
http://sysoev.ru/en/

Il giorno 03/ago/2010, alle ore 16.55, timeu ha scritto:

Thanks Roberto !

I was going crazy while trying to figure out what might have been the
problem of the wrong URLs :wink:

I couldn’t find the message in the mailing list archive. What
description should I search for?

Thanks in advance

The “useful” discussion started here:

http://lists.unbit.it/pipermail/uwsgi/2010-July/000484.html

the problem was in the “wrong way” uWSGI uses to manage empty
SCRIPT_NAME


Roberto De Ioris
http://unbit.it
JID: [email protected]

Thanks Roberto !

I was going crazy while trying to figure out what might have been the
problem of the wrong URLs :wink:

I couldn’t find the message in the mailing list archive. What
description should I search for?

Thanks in advance


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,116092,116118#msg-116118

Hi Igor,

apparantly I wrote a reply but didn’t post it.

I tried that actually but when I remove this entry from the nginx.conf,
Pylons complains that the SCRIPT_NAME key in the request dict is missing
(I can post the error message later)
If I just add the uwsgi_param SCRIPT_NAME entry without the “/” nginx
wont’t start.

Ãœmit

Try to remove
uwsgi_param SCRIPT_NAME /;

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,116092,116469#msg-116469

Thanks !

Roberto De Io>

The “useful” discussion started here:

http://lists.unbit.it/pipermail/uwsgi/2010-July/00
0484.html

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,116092,116470#msg-116470

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs