On Aug 11, 11:01 am, Weixi Yen <[email protected]> wrote: > Thanks, turns out the SCRIPT_NAME /; is handled incorrectly. > > Running liveheaders, it appears that when redirect_to is used, then the > request gets served ashttp://controller/actionwithout the domain. > > I think it's appending "/" to another "/" to cause a double // > > No idea of a workaround though =/
Not surprising really. This is because WSGI specification dictates that SCRIPT_NAME shouldn't ever be ''/' by itself. For URL against root of site, should be: SCRIPT_NAME = PATH_INFO = / The PATH_INFO must always have a leading '/' and thus why for root of site, SCRIPT_NAME would end up being empty. So, try using: uwsgi_param SCRIPT_NAME ; Graham > > On Tue, Aug 10, 2010 at 3:26 PM, cd34 <[email protected]> wrote: > > uwsgi runs as a daemon, and nginx talks to it. uwsgi does some rather > > aggressive caching which makes for a very fast pylons app. > > > If I recall, I had problems with versions newer than 0.9.4.4, but, > > haven't tried any later releases. The command line I use is: > > > /usr/src/uwsgi-0.9.4.4/uwsgi -d /tmp/uwsgi.log --uid 1000 --gid 1000 - > > s /tmp/uwsgi.sock -C -iH /var/www/facebook/ --paste config:/var/www/ > > facebook/fbapp/production.ini > > > And my application handles / > > > The question is, what is redirecting incorrectly? > > > I strip off /static/ and /fb/ and allow nginx to serve those: > > > location ^~ /static/ { > > alias /var/www/xxxxxx.com/static/; > > } > > location ^~ /fb/ { > > alias /var/www/xxxxxx.com/fb/; > > } > > location / { > > uwsgi_pass unix:/tmp/uwsgi.sock; > > include uwsgi_params; > > } > > > and I believe I added: > > > uwsgi_param SCRIPT_NAME /; > > > in uwsgi_params. > > >http://cd34.com/blog/programming/python/pylons-and-facebook-applicati... > > and > >http://tonylandis.com/python/deployment-howt-pylons-nginx-and-uwsgi/ > > > detail it a bit more. > > > I didn't have any problems using redirect_to which was used in a few > > places. Based on your description, it is possible SCRIPT_NAME is > > missing which would give you urls like: > >http://domain.com/physical/disk/path/controller/action > > > If you can run something like livehttpheaders in firefox, or, even > > something as basic as telnetting to nginx's port and doing a request > > to see what the Location: header is, it might be a little easier to > > troubleshoot it. > > > -- > > You received this message because you are subscribed to the Google Groups > > "pylons-discuss" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<pylons-discuss%2bunsubscr...@go > > oglegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/pylons-discuss?hl=en. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
