English 中文(简体)
What could cause a redirect loop with Pylons + uWSGI + Cherokee?
原标题:

I had no issue with Django + uWSGI + Cherokee. BUt I would like to try pylons before committing to either framework.

I followed the tutorial from pylonshq.com - 1.0/gettingstarted

I ran into no problems when running pylons with paste.

So I used instructions to run pylons with uWSGI from projects.unbit.it - uwsgi/wiki/UsePaste

This is the source interpreter line I used with Cherokee (connection 127.0.0.1:5000):

uwsgi -s 127.0.0.1:5000 --paste config:/var/www/pylons/example/development.ini -H /var/www/pylons/ -M

My vServer in Cherokee is bokken.test.com with root directory: /var/www/pylons/example/example/public (I ve tried with and without trailing slash)

My "Directory /" rule handler is set to the uWSGI source, but no root directory is set for the specific handler.

When I visit bokken.test.com, I get a redirect loop error.

Google Chrome:

The webpage at http://bokken.test.com// has resulted in too many redirects (Notice the extra slash).
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

Error.log:

*** Starting uWSGI 0.9.5.4 (32bit) on [Sat Aug  7 19:01:51 2010] ***
compiled with version: 4.4.3
Python version: 2.6.5 (r265:79063, Apr 16 2010, 13:28:26) 
[GCC 4.4.3]
your memory page size is 4096 bytes
allocated 372 bytes (0 KB) for 1 request s buffer.
Setting PythonHome to /var/www/pylons/...
binding on TCP port: 5000
your server socket listen backlog is limited to 64 connections
initializing hooks...done.
Loading paste environment: config:/var/www/pylons/example/development.ini
application 0 (/) ready
setting default application to 0
spawned uWSGI master process (pid: 1278)
spawned uWSGI worker 1 (pid: 1280)
[pid: 1280|app: 0|req: 1/1] 192.168.0.198 () {52 vars in 926 bytes} [Sat Aug  7 19:01:55 2010] GET / => generated 433 bytes in 7 msecs (HTTP/1.1 301) 2 headers in 95 bytes (0 async switches on async core 0)

Unlike Django, none of the tutorials I found specify a uwsgi.xml or .wsgi script. I m not sure what needs to change.

最佳回答

You say that you ve set the file root of the Cherokee vServer to the /example/public directory of your Pylons project. That seems likely to be a problem - Pylons looks in the public directory for files to serve before attempting to match a controller, so you re setting yourself up for future issues there. The root folder of the Pylons app should probably be where you point the vServer at, and let Pylons handle its own chunk of the directory tree.

Also, you will definitely need a .wsgi script - the last bit of your question implies that you don t have one? It s a little confusing - please clarify.

问题回答

暂无回答




相关问题
How to use redirect_to to a non-Rails URL with query params?

We just had an existing use of redirect_to break due to a Rails upgrade, and it led to a question. I ve been experimenting, and I don t seem to find a way to use redirect_to to send the user to a non-...

Apache authentication: Redirect on failure, reliably?

I ve set my ErrorDocument 401 to point to my website s account creation page, but not all browsers seem to honor this redirect (Safari). Also, other browsers (Firefox, Chrome) never quit asking for ...

Response.Redirect HTTP status code

Why is it that ASP/ASP.NET Response.Redirect uses a HTTP-302 status code ("Moved Temporarily") even though in most cases a HTTP-301 status code ("Moved Permanently") would be more appropriate?

Exceptions: redirect or render?

I m trying to standardize the way I handle exceptions in my web application (homemade framework) but I m not certain of the "correct" way to handle various situations. I m wondering if there is a ...

Cakephp is not redirecting properly when pages are cached

I am having some issues with a site that was working correctly until i implemented full page caching in CakePHP. I have followed the guidance in the Manual and have my $session->flash in a no-cache ...

热门标签